Esempio n. 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);
        }
Esempio n. 2
0
 public string ToJson()
 {
     BeforeSerialize();
     return(TJson.ToJson(this, this.GetType()));
 }
Esempio n. 3
0
 protected virtual void AfterDeserialize(TJson obj)
 {
 }
Esempio n. 4
0
 protected virtual void BeforeSerialize(TJson obj)
 {
 }
Esempio n. 5
0
 public string ToJson()
 {
     BeforeSerialize();
     return(TJson.ToJson(this, GetJasonDataType()));
 }
Esempio n. 6
0
        public static T DeepClone <T>(this TJson Source) where T : TJson
        {
            string jsonString = Source.ToJson();

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