public void Serialize <TObject> (TObject obj, Stream stream, XmlSerializationOptions options) { if (options == null) { serializer.Serialize(obj, stream); } else { serializer.Serialize(obj, stream, new XmlSerializationOptions <Nothing> { Encoding = options.Encoding, XmlDeclarationType = options.XmlDeclarationType }); } }
public string GetString <TObject> (TObject obj, XmlSerializationOptions options) { if (options == null) { return(serializer.GetString(obj)); } else { return(serializer.GetString(obj, new XmlSerializationOptions <Nothing> { Encoding = options.Encoding, XmlDeclarationType = options.XmlDeclarationType })); } }
public XmlSerializationOptions(XmlSerializationOptions <TContext> options) { if (options == null) { Encoding = Helper.UTF8Unsigned; Context = default(TContext); XmlDeclarationType = 0; } else { Encoding = options.Encoding ?? Helper.UTF8Unsigned; Context = options.Context; XmlDeclarationType = options.XmlDeclarationType; } }