public PlantumlExporter( ITypeWriter typeWriter, ITypeNameConverter escapedTypeNameConverter) { _typeWriter = typeWriter; _escapedTypeNameConverter = escapedTypeNameConverter; }
///<summary> ///</summary> ///<param name = "typeNameConverter"></param> ///<param name = "encoding"></param> ///<exception cref = "ArgumentNullException"></exception> public BurstBinaryReader(ITypeNameConverter typeNameConverter, Encoding encoding) { if (typeNameConverter == null) throw new ArgumentNullException("typeNameConverter"); if (encoding == null) throw new ArgumentNullException("encoding"); _typeNameConverter = typeNameConverter; _encoding = encoding; }
public SampleSettingsReader( ITypeNameConverter typeNameConverter, ISettingsSource <SampleSource> source, IDeserializer <SampleSource> deserializer) : base(typeNameConverter, source, deserializer) { }
private void initialize(SharpSerializerBinarySettings settings) { // PropertiesToIgnore this.PropertyProvider.PropertiesToIgnore = settings.AdvancedSettings.PropertiesToIgnore; this.PropertyProvider.AttributesToIgnore = settings.AdvancedSettings.AttributesToIgnore; //RootName this.RootName = settings.AdvancedSettings.RootName; // TypeNameConverter) ITypeNameConverter typeNameConverter = settings.AdvancedSettings.TypeNameConverter ?? DefaultInitializer.GetTypeNameConverter( settings.IncludeAssemblyVersionInTypeName, settings.IncludeCultureInTypeName, settings.IncludePublicKeyTokenInTypeName); // Create Serializer and Deserializer Polenter.Serialization.Advanced.Binary.IBinaryReader reader = null; Polenter.Serialization.Advanced.Binary.IBinaryWriter writer = null; if (settings.Mode == BinarySerializationMode.Burst) { // Burst mode writer = new BurstBinaryWriter(typeNameConverter, settings.Encoding); reader = new BurstBinaryReader(typeNameConverter, settings.Encoding); } else { // Size optimized mode writer = new SizeOptimizedBinaryWriter(typeNameConverter, settings.Encoding); reader = new SizeOptimizedBinaryReader(typeNameConverter, settings.Encoding); } this._deserializer = new BinaryPropertyDeserializer(reader); this._serializer = new BinaryPropertySerializer(writer); }
/// <summary> /// Default is CultureInfo.InvariantCulture used /// </summary> public SimpleValueConverter() { _cultureInfo = CultureInfo.InvariantCulture; _typeNameConverter = new TypeNameConverter(); // Alternatively //_cultureInfo = System.Threading.Thread.CurrentThread.CurrentCulture; }
private void initialize(SharpSerializerXmlSettings settings) { // PropertiesToIgnore PropertyProvider.PropertiesToIgnore = settings.AdvancedSettings.PropertiesToIgnore; PropertyProvider.AttributesToIgnore = settings.AdvancedSettings.AttributesToIgnore; //RootName RootName = settings.AdvancedSettings.RootName; // TypeNameConverter) ITypeNameConverter typeNameConverter = settings.AdvancedSettings.TypeNameConverter ?? DefaultInitializer.GetTypeNameConverter( settings.IncludeAssemblyVersionInTypeName, settings.IncludeCultureInTypeName, settings.IncludePublicKeyTokenInTypeName); // SimpleValueConverter ISimpleValueConverter simpleValueConverter = settings.AdvancedSettings.SimpleValueConverter ?? DefaultInitializer.GetSimpleValueConverter(settings.Culture, typeNameConverter); // XmlWriterSettings XmlWriterSettings xmlWriterSettings = DefaultInitializer.GetXmlWriterSettings(settings.Encoding); // XmlReaderSettings XmlReaderSettings xmlReaderSettings = DefaultInitializer.GetXmlReaderSettings(); // Create Serializer and Deserializer var reader = new DefaultXmlReader(typeNameConverter, simpleValueConverter, xmlReaderSettings); var writer = new DefaultXmlWriter(typeNameConverter, simpleValueConverter, xmlWriterSettings); _serializer = new XmlPropertySerializer(writer); _deserializer = new XmlPropertyDeserializer(reader); }
///<summary> ///</summary> ///<param name = "typeNameConverter"></param> ///<param name = "encoding"></param> ///<exception cref = "ArgumentNullException"></exception> public SizeOptimizedBinaryWriter(ITypeNameConverter typeNameConverter, Encoding encoding) { if (typeNameConverter == null) throw new ArgumentNullException("typeNameConverter"); if (encoding == null) throw new ArgumentNullException("encoding"); _encoding = encoding; _typeNameConverter = typeNameConverter; }
protected BaseSettingsReader( ITypeNameConverter typeNameConverter, ISettingsSource <TSource> source, IDeserializer <TSource> deserializer) { _typeNameConverter = typeNameConverter; _source = source; _deserializer = deserializer; }
public TypeRelationsWriter( ITypeNameConverter escapedTypeNameConverter, TextWriter writer, HashSet <Type> typesToWrite) { _escapedTypeNameConverter = escapedTypeNameConverter; _writer = writer; _typesToWrite = typesToWrite; }
///<summary> ///</summary> ///<param name = "typeNameConverter"></param> ///<param name = "valueConverter"></param> ///<param name = "settings"></param> ///<exception cref = "ArgumentNullException"></exception> public DefaultXmlReader(ITypeNameConverter typeNameConverter, ISimpleValueConverter valueConverter, XmlReaderSettings settings) { if (typeNameConverter == null) throw new ArgumentNullException("typeNameConverter"); if (valueConverter == null) throw new ArgumentNullException("valueConverter"); if (settings == null) throw new ArgumentNullException("settings"); _typeNameConverter = typeNameConverter; _valueConverter = valueConverter; _settings = settings; }
///<summary> ///</summary> ///<param name = "typeNameConverter"></param> ///<param name = "encoding"></param> ///<exception cref = "ArgumentNullException"></exception> public BurstBinaryWriter(ITypeNameConverter typeNameConverter, Encoding encoding) { if (typeNameConverter == null) { throw new ArgumentNullException("typeNameConverter"); } if (encoding == null) { throw new ArgumentNullException("encoding"); } _encoding = encoding; _typeNameConverter = typeNameConverter; }
/// <summary> /// Constructor with custom ITypeNameProvider and ISimpleValueConverter and custom XmlWriterSettings /// </summary> public DefaultXmlWriter(ITypeNameConverter typeNameProvider, ISimpleValueConverter simpleValueConverter, XmlWriterSettings settings) { if (typeNameProvider == null) throw new ArgumentNullException("typeNameProvider"); if (simpleValueConverter == null) throw new ArgumentNullException("simpleValueConverter"); if (settings == null) throw new ArgumentNullException("settings"); _simpleValueConverter = simpleValueConverter; _settings = settings; _typeNameProvider = typeNameProvider; }
/// <summary> /// </summary> /// <param name="typeNameConverter"></param> /// <param name="encoding"></param> /// <exception cref="ArgumentNullException"></exception> public BurstBinaryWriter(ITypeNameConverter typeNameConverter, Encoding encoding) { if (typeNameConverter == null) { throw new ArgumentNullException(nameof(typeNameConverter)); } if (encoding == null) { throw new ArgumentNullException(nameof(encoding)); } _encoding = encoding; _typeNameConverter = typeNameConverter; }
// Translation table of property names ///<summary> ///</summary> ///<param name = "typeNameConverter"></param> ///<param name = "encoding"></param> ///<exception cref = "ArgumentNullException"></exception> public SizeOptimizedBinaryReader(ITypeNameConverter typeNameConverter, Encoding encoding) { if (typeNameConverter == null) { throw new ArgumentNullException(nameof(typeNameConverter)); } if (encoding == null) { throw new ArgumentNullException(nameof(encoding)); } _typeNameConverter = typeNameConverter; _encoding = encoding; }
///<summary> ///</summary> ///<param name = "typeNameConverter"></param> ///<param name = "encoding"></param> ///<exception cref = "ArgumentNullException"></exception> public SizeOptimizedBinaryWriter(ITypeNameConverter typeNameConverter, Encoding encoding) { if (typeNameConverter == null) { throw new ArgumentNullException("typeNameConverter"); } if (encoding == null) { throw new ArgumentNullException("encoding"); } _encoding = encoding; _typeNameConverter = typeNameConverter; }
///<summary> ///</summary> ///<param name = "typeNameConverter"></param> ///<param name = "encoding"></param> ///<exception cref = "ArgumentNullException"></exception> public BurstBinaryReader(ITypeNameConverter typeNameConverter, Encoding encoding) { if (typeNameConverter == null) { throw new ArgumentNullException("typeNameConverter"); } if (encoding == null) { throw new ArgumentNullException("encoding"); } _typeNameConverter = typeNameConverter; _encoding = encoding; }
public SimpleTypeWriter( ITypeQueryFactory typeQueryFactory, ITypeNameWriter typeNameWriter, ITypeNameConverter typeNameConverter, IEventWriter eventWriter, IMethodWriter methodWriter, IFieldWriter fieldWriter, IPropertyWriter propertyWriter) { _typeQueryFactory = typeQueryFactory; _typeNameWriter = typeNameWriter; _typeNameConverter = typeNameConverter; _eventWriter = eventWriter; _methodWriter = methodWriter; _fieldWriter = fieldWriter; _propertyWriter = propertyWriter; }
///<summary> ///</summary> ///<param name = "typeNameConverter"></param> ///<param name = "valueConverter"></param> ///<param name = "settings"></param> ///<exception cref = "ArgumentNullException"></exception> public DefaultXmlReader(ITypeNameConverter typeNameConverter, ISimpleValueConverter valueConverter, XmlReaderSettings settings) { if (typeNameConverter == null) { throw new ArgumentNullException("typeNameConverter"); } if (valueConverter == null) { throw new ArgumentNullException("valueConverter"); } if (settings == null) { throw new ArgumentNullException("settings"); } _typeNameConverter = typeNameConverter; _valueConverter = valueConverter; _settings = settings; }
public DatabasePersister(IDatabaseBase database) { this.database = database; PolymorphDatabaseAttribute polymorphAttr = database.GetType().GetCustomAttribute <PolymorphDatabaseAttribute>(); if (polymorphAttr != null) { isPolymorph = true; typeNameConverter = polymorphAttr.Converter; } XmlTagNamesAttribute tagNameAttr = database.GetType().GetCustomAttribute <XmlTagNamesAttribute>(); if (tagNameAttr != null) { rootTag = tagNameAttr.RootTag; itemTag = tagNameAttr.ItemTag; } }
/// <summary> /// Constructor with custom ITypeNameProvider and ISimpleValueConverter and custom XmlWriterSettings /// </summary> public DefaultXmlWriter(ITypeNameConverter typeNameProvider, ISimpleValueConverter simpleValueConverter, XmlWriterSettings settings) { if (typeNameProvider == null) { throw new ArgumentNullException("typeNameProvider"); } if (simpleValueConverter == null) { throw new ArgumentNullException("simpleValueConverter"); } if (settings == null) { throw new ArgumentNullException("settings"); } _simpleValueConverter = simpleValueConverter; _settings = settings; _typeNameProvider = typeNameProvider; }
public MethodWriter(ITypeNameConverter typeNameConverter, ITypeNameWriter typeNameWriter) { _typeNameConverter = typeNameConverter; _typeNameWriter = typeNameWriter; }
/// <summary> /// </summary> /// <param name="typeNameConverter"></param> /// <param name="encoding"></param> /// <exception cref="ArgumentNullException"></exception> public SizeOptimizedBinaryWriter(ITypeNameConverter typeNameConverter, Encoding encoding) { _encoding = encoding ?? throw new ArgumentNullException(nameof(encoding)); _typeNameConverter = typeNameConverter ?? throw new ArgumentNullException(nameof(typeNameConverter)); }
/// <summary> /// </summary> /// <param name="typeNameConverter"></param> /// <param name="encoding"></param> /// <exception cref="ArgumentNullException"></exception> public BurstBinaryReader(ITypeNameConverter typeNameConverter, Encoding encoding) { _typeNameConverter = typeNameConverter ?? throw new ArgumentNullException(nameof(typeNameConverter)); _encoding = encoding ?? throw new ArgumentNullException(nameof(encoding)); }
public SimpleTypeNameWriter(ITypeNameConverter typeNameConverter) { _typeNameConverter = typeNameConverter; }
public static ISimpleValueConverter GetSimpleValueConverter(CultureInfo cultureInfo, ITypeNameConverter typeNameConverter) { return(new SimpleValueConverter(cultureInfo, typeNameConverter)); }
public static ISimpleValueConverter GetSimpleValueConverter(CultureInfo cultureInfo, ITypeNameConverter typeNameConverter) { return new SimpleValueConverter(cultureInfo, typeNameConverter); }
/// <summary> /// Here you can customize the culture. I.e. System.Threading.Thread.CurrentThread.CurrentCulture /// </summary> /// <param name = "cultureInfo"></param> /// <param name="typeNameConverter"></param> public SimpleValueConverter(CultureInfo cultureInfo, ITypeNameConverter typeNameConverter) { _cultureInfo = cultureInfo; _typeNameConverter = typeNameConverter; }
//------------------------------------------------------------------------------ public TypeNameConverter(ITypeNameConverter customTypeNameConverter) { m_customTypeNameConverter = customTypeNameConverter; }