public Serializers(Dictionary <Type, ISerializer> map, TypeMap types) { this.serializers = map; this.TypeMap = types; Tagged = new UnknownTypeSerializer(this, types); TypeMapSerializer = new TypeMapSerializer(types); }
public Serializers() { serializers = new Dictionary <Type, ISerializer> (); TypeMap = new TypeMap(); Add <byte[]>(new ByteArraySerializer()) .Add <string> (new StringSerializer()) .Add <sbyte>(new Int8Serializer()) .Add <short> (new Int16Serializer()) .Add <int>(new Int32Serializer()) .Add <long> (new Int64Serializer()) .Add <byte>(new UInt8Serializer()) .Add <ushort> (new UInt16Serializer()) .Add <uint>(new UInt32Serializer()) .Add <ulong>(new UInt64Serializer()) .Add <float> (new FloatSerializer()) .Add <double>(new DoubleSerializer()) .Add <Guid>(new GuidSerializer()) .Add <decimal>(new DecimalSerializer()) .Add <TimeSpan>(new TimeSpanSerializer()) .Add <bool>(new BoolSerializer()) .Add <DateTime> (new DateTimeSerializer()); Tagged = new UnknownTypeSerializer(this, TypeMap); TypeMapSerializer = new TypeMapSerializer(TypeMap); }