예제 #1
0
 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
         });
     }
 }
예제 #2
0
 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
         }));
     }
 }
예제 #3
0
 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;
     }
 }