예제 #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
파일: JsonHelper.cs 프로젝트: windygu/zcgl
        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));
 }