SharpYaml is a .NET library for YAML
Перейти к файлу
Martin Evans 48566a08c2 Modified a unit test to fail due to issue #10 (serializing decimal types)
Fixed issue #10 which prevented the serialization of C# decimal types

Martin Evans <martindevans@gmail.com>
2015-07-13 16:07:49 +01:00
.nuget Update nuget 2015-05-13 23:21:40 +09:00
Dumper Rename project to SharpYaml 2013-10-25 07:45:40 +09:00
SharpYaml Modified a unit test to fail due to issue #10 (serializing decimal types) 2015-07-13 16:07:49 +01:00
SharpYaml.Samples Rename project to SharpYaml 2013-10-25 07:45:40 +09:00
SharpYaml.Tests Modified a unit test to fail due to issue #10 (serializing decimal types) 2015-07-13 16:07:49 +01:00
SharpYamlEditor Rename project to SharpYaml 2013-10-25 07:45:40 +09:00
doc/html Added: Version file. 2010-05-31 22:07:42 +00:00
support Add Serialize() method to YamlSerializer for backwards compatibility. 2012-12-10 16:28:12 +00:00
.gitignore Utilize NuGet to handle the xUnit.net dependency. 2013-08-20 16:39:01 +02:00
CommonAssemblyInfo.cs Push new nuget 1.4 version 2015-05-13 23:54:21 +09:00
LICENSE.txt Update license and nuget 2013-11-03 17:01:49 +09:00
README.md Fix nuget package to allow .NET 4.0+ 2013-11-03 17:09:30 +09:00
SharpYaml.build Rename project to SharpYaml 2013-10-25 07:45:40 +09:00
SharpYaml.sln Update to VS2013 2015-05-13 21:07:37 +09:00
SharpYaml.sln.DotSettings Update license and nuget 2013-11-03 17:01:49 +09:00
SharpYaml.snk Update license and nuget 2013-11-03 17:01:49 +09:00
VERSION Created version 1.1 2010-05-31 22:09:11 +00:00
build.bat Update license and nuget 2013-11-03 17:01:49 +09:00

README.md

SharpYaml

SharpYaml is a .NET library that provides a YAML parser and serialization engine for .NET objects.

Usage

var serializer = new Serializer();
var text = serializer.Serialize(new { List = new List<int>() { 1, 2, 3 }, Name = "Hello", Value = "World!" });
Console.WriteLine(text);

Output:

List:
  - 1
  - 2
  - 3
Name: Hello
Value: World!

Features

SharpYaml is a fork of YamlDotNet and is adding the following features:

  • Supports for 4.0+ .NET Portable Class Library compatible with Windows desktop, Windows Phone 8 and Windows RT
  • Completely rewritten serialization/deserialization engine
  • A single interface IYamlSerializable for implementing custom serializers, along IYamlSerializableFactory to allow dynamic creation of serializers. Registration can be done through SerializerSettings.RegisterSerializer and SerializerSettings.RegisterSerializerFactory
    • Can inherit from ScalarSerializerBase to provide custom serialization to/from a Yaml scalar
  • Supports for custom collection that contains user properties to serialize along the collection.
  • Supports for Yaml 1.2 schemas
  • A centralized type system through ITypeDescriptor and IMemberDescriptor
  • Highly configurable serialization using SerializerSettings (see usage)
    • Add supports to register custom attributes on external objects (objects that you can't modify) by using SerializerSettings.Register(memberInfo, attribute)
    • Several options and settings: EmitAlias, IndentLess, SortKeyForMapping, EmitJsonComptible, EmitCapacityForList, LimitPrimitiveFlowSequence, EmitDefaultValues
    • Add supports for overriding the Yaml style of serialization (block or flow) with SerializerSettings.DefaultStyle and SerializerSettings.DynamicStyleFormat
  • Supports for registering an assembly when discovering types to deserialize through SerializerSettings.RegisterAssembly
  • Memory allocation and GC pressure improved

Available from Nuget

You can download SharpYaml binaries directly from nuget.

License

MIT