示例#1
0
        public static object Parse(Type type, string json)
        {
            object result = TJson.Deserialize(type, json);
            IJson  jObj   = result as IJson;

            if (jObj != null)
            {
                jObj.AfterDeserialize();
            }
            return(result);
        }
示例#2
0
 public string ToJson()
 {
     BeforeSerialize();
     return(TJson.ToJson(this, this.GetType()));
 }
示例#3
0
 protected virtual void AfterDeserialize(TJson obj)
 {
 }
示例#4
0
 protected virtual void BeforeSerialize(TJson obj)
 {
 }
示例#5
0
 public string ToJson()
 {
     BeforeSerialize();
     return(TJson.ToJson(this, GetJasonDataType()));
 }
示例#6
0
        public static T DeepClone <T>(this TJson Source) where T : TJson
        {
            string jsonString = Source.ToJson();

            return(jsonString.ParseJSON <T>());
        }
示例#7
0
 public T Create <T>() where T : SerializableData
 {
     return(TJson.DeepColne <T>(this as T));
 }