/// <summary> /// Creates and initializes a new instance of the ManateeJsonSerializer class. /// </summary> private DefaultJsonSerializer() { _serializer = new JsonSerializer { Options = { FlagsEnumSeparator = "," } }; InitializeAbstractionMap(_serializer); SerializerFactory.AddSerializer(new ActionTypeSerializer()); SerializerFactory.AddSerializer(new DateTimeSerializer()); }
public void Can_Add_Serializer() { SerializerFactory.AddSerializer(new ProtoBufSerializer(), "ProtoBuf"); SerializerFactory.AddSerializer(new JsonNetSerializer(), new string[] { "b", "a" }); foreach (var key in SerializerFactory.Alias) { Assert.True(SerializerFactory.Contains(key)); } }
public NETSerializerTest() { var type = typeof(INetMessage); var types = type.Assembly.GetTypes() .Where(t => !t.IsInterface && t.IsClass && !t.IsAbstract && type.IsAssignableFrom(t)) .ToArray(); NetSerializer.Serializer instance = new NetSerializer.Serializer(types); NETSerializer ns = new NETSerializer(instance); SerializerFactory.AddSerializer(new NETSerializer(instance), "NET"); }
public static void Main(string[] args) { #if NETFULL NetSerializer.Serializer instance = new NetSerializer.Serializer(new[] { typeof(Foo), typeof(SerializerWrapper) }); NETSerializer ns = new NETSerializer(instance); SerializerFactory.AddSerializer(new NETSerializer(instance), "NET"); #endif SerializerFactory.AddSerializer <JilSerializer>("jil"); SerializerFactory.AddSerializer <JsonNetSerializer>("jsonNet"); SerializerFactory.AddSerializer <ProtoBufSerializer>("ProtoBuf"); TestExcute.Excute(typeof(Program)); }
public TextJsonSerializerTest() { SerializerFactory.AddSerializer <TextJsonSerializer>("textJson"); }
public ExtendTest() { SerializerFactory.AddSerializer <JilSerializer>("jil"); SerializerFactory.AddSerializer <JsonNetSerializer>("jsonNet"); SerializerFactory.AddSerializer <ProtoBufSerializer>("ProtoBuf"); }
public ProtoBufSerializerTest() { SerializerFactory.AddSerializer <ProtoBufSerializer>("ProtoBuf"); }
static CryptographyHelpers() { SerializerFactory.AddSerializer(new ByteArraySerializer()); }
public JilSerializerTest() { SerializerFactory.AddSerializer <JilSerializer>("jil"); }
public JsonNetSerializerTest() { SerializerFactory.AddSerializer <JsonNetSerializer>("jsonNet"); }