public static NS.Serializer CreateSerializer() { var types = GetKnownTypes().ToArray(); var sw = Stopwatch.StartNew(); var settings = new NS.Settings() { CustomTypeSerializers = new NS.ITypeSerializer[] { new TriDimArrayCustomSerializer() }, }; var serializer = new NS.Serializer(types, settings); sw.Stop(); Console.WriteLine("Serializer.Initialize() in {0} ms", sw.ElapsedMilliseconds); //NS.Serializer.GenerateDebugAssembly(types, new NS.ITypeSerializer[] { new TriDimArrayCustomSerializer() }); return serializer; }
public static NS.Serializer CreateSerializer() { var types = GetKnownTypes().ToArray(); var sw = Stopwatch.StartNew(); var settings = new NS.Settings() { CustomTypeSerializers = new NS.ITypeSerializer[] { new TriDimArrayCustomSerializer() }, }; var serializer = new NS.Serializer(types, settings); sw.Stop(); Console.WriteLine("Serializer.Initialize() in {0} ms", sw.ElapsedMilliseconds); //NS.Serializer.GenerateDebugAssembly(types, new NS.ITypeSerializer[] { new TriDimArrayCustomSerializer() }); return(serializer); }
public static NS.Serializer CreateSerializer() { var types = GetKnownTypes().ToArray(); var sw = Stopwatch.StartNew(); var settings = new NS.Settings() { CustomTypeSerializers = new NS.ITypeSerializer[] { new TriDimArrayCustomSerializer() }, BeforeSerializingObjectOfType = type => m_serializedTypes.Add(type), BeforeDeserializingObjectWithTypeId = id => m_deserializedTypeIds.Add(id) }; var serializer = new NS.Serializer(types, settings); sw.Stop(); Console.WriteLine("Serializer.Initialize() in {0} ms", sw.ElapsedMilliseconds); //NS.Serializer.GenerateDebugAssembly(types, new NS.ITypeSerializer[] { new TriDimArrayCustomSerializer() }); return(serializer); }