public SerializationLibrary(SerializationLibrary base_lib) { BaseLibrary = base_lib; ReadOnly = false; DefaultSerializers = new List <ISerializer>(); Serializers = new HashSet <ISerializer>(); TypeDeserializers = new Dictionary <Type, ISerializer>(); TypeSerializers = new Dictionary <Type, ISerializer>(); }
private SerializationLibrary(SerializationLibrary lib, bool read) { DefaultSerializers = new List <ISerializer>(lib.DefaultSerializers); Serializers = new HashSet <ISerializer>(lib.Serializers); if (ReadOnly = read) { Serializers.TrimExcess(); } TypeDeserializers = new Dictionary <Type, ISerializer>(lib.TypeDeserializers); TypeSerializers = new Dictionary <Type, ISerializer>(lib.TypeSerializers); if (!lib.BaseLibrary?.ReadOnly ?? false) { BaseLibrary = new SerializationLibrary(lib.BaseLibrary, true); } else { BaseLibrary = lib.BaseLibrary; } }
internal SerializationInstance(SerializationLibrary lib, StreamingContext context) { Library = lib; Context = context; }