public override void Serialize(object obj, Stream s, BaseSerializerOptions opt)
 {
     if (opt is TextSerializerOptions options)
     {
     }
     else
     {
     }
 }
示例#2
0
    static void Test(BaseSerializerOptions o)
    {
        var obj = new Object();

        using (var fs = File.Open("...", FileMode.Create))
        {
            var r1 = Serializer.Write(obj, fs, o);
            CheckSerializerResults(r1);
        }
    }
示例#3
0
    public static SerializerResult Write(Object obj, Stream s, BaseSerializerOptions opt)
    {
        switch (opt)
        {
        case TextSerializerOptions o: return(WriteText(obj, s, o));

        case BinarySerializerOptions o: return(WriteBinary(obj, s, o));
        }
        throw new Exception();
    }