示例#1
0
        public override object Deserialize(DynamicSerializer serializer, DataStream ds)
        {
            DynamicStructure dynvalue = new DynamicStructure();

            foreach (var field in Fields)
            {
                object vv = serializer.ReadField(field.Value, ds);
                dynvalue.Dictionary[field.Key.ToLower()] = vv;
            }
            return(dynvalue);
        }
示例#2
0
        public override void Serialize(DynamicSerializer serializer, DataStream ds, object value)
        {
            DynamicStructure dynvalue = (DynamicStructure)value;

            foreach (var field in Fields)
            {
                object vv;
                if (dynvalue != null)
                {
                    dynvalue.Dictionary.TryGetValue(field.Key.ToLower(), out vv);
                }
                else
                {
                    vv = null;
                }

                serializer.WriteField(field.Value, ds, vv);
            }
        }
示例#3
0
 public override object Deserialize(DynamicSerializer serializer, DataStream ds)
 {
     return(Reader(ds));
 }
示例#4
0
 public override void Serialize(DynamicSerializer serializer, DataStream ds, object value)
 {
     Writer(ds, value);
 }
示例#5
0
 public virtual object Deserialize(DynamicSerializer serializer, DataStream ds)
 {
     throw new NotImplementedException();
 }
示例#6
0
 public virtual void Serialize(DynamicSerializer serializer, DataStream ds, object value)
 {
     throw new NotImplementedException();
 }