public void FromJson(string content) { DictTmp tmp = new DictTmp(content); Namespace = tmp.Get("Namespace"); Debug = tmp.GetAsBool("IsDebug", true); AssemblyCount = tmp.GetAsInt("AssemblyCount", 0); ModelCount = tmp.GetAsInt("ModelCount", 0); }
public void FromJson(string content) { if (!_owner.IsDebug) { content = CML.ComUtility.GetString(content); } DictTmp tmp = new DictTmp(content); cls = tmp.Get("type"); key = tmp.Get("key"); asm = tmp.Get("asm"); model = _owner.GetService(asm, cls) as IModel; model.owner = _owner; model.FromJson(tmp.Get("model")); //local = tmp.GetAsBool("local"); //asmkey = tmp.Get("asmid"); //if (!local && _owner != null) //{ // model = _owner.GetModel(typekey); // if (model != null) // { // model.FromString(tmp.Get("model")); // //model.FromString(CML.ComUtility.GetString(tmp.Get("model"))); // } //} //else if (local) //{ // //Assembly asm = _owner.FindAsm(asmname); // //if (asm != null) // //{ // // Type t = asm.GetType(typekey); // // if (t != null) // // { // // model = Activator.CreateInstance(t) as IModel; // // if (model != null) // // { // // model.FromString(tmp.Get("model")); // // //model.FromString(CML.ComUtility.GetString(tmp.Get("model"))); // // } // // } // //} //} }
public override string ToString() { string content = new DictTmp( "type", cls , "key", key , "model", model //"model", CML.ComUtility.GetBase64(model), //"local", local, , "asm", asm //"asmid", asmkey ).ToString(); if (_owner.IsDebug) { return(content); } else { return(CML.ComUtility.GetBase64(content)); } }