void ITypeSerialize.MergeFrom(ref object value, IStream ms) { string enumStr = ms.ReadString(); value = Str2Enum.To(enumStr, enumType); }
} // 类型标识 void ITypeSerialize.WriteTo(object obj, IStream ms) { ms.WriteString(Str2Enum.GetEnumStr(obj, enumType)); }
// 把值写入到ab当中 void ITypeSerialize.WriteTo(object value, Nested.AnyBase ab) { ab.baseValue = Str2Enum.GetEnumStr(value, enumType); }
// 通过ab来设置值 void ITypeSerialize.MergeFrom(ref object value, Nested.AnyBase ab) { value = Str2Enum.To(ab.baseValue, enumType); }
void ITypeSerialize.MergeFrom(ref object value, IStream ms) { var text = ms.ReadString(); value = Str2Enum.To(text, enumType); }