//--------------------------------------------------------------------- public Prop <T> defProp <T>(Dictionary <string, string> map_param, string key, T default_value, bool collect_dirty = true) { PropDef prop_def = new PropDef(key, typeof(T), collect_dirty); mMapPropDef[prop_def.getKey()] = prop_def; Prop <T> prop = new Prop <T>(this, prop_def, default_value); mMapProp[prop_def.getKey()] = prop; if (map_param == null) { return(prop); } string json = null; if (map_param.TryGetValue(prop_def.getKey(), out json)) { if (!string.IsNullOrEmpty(json)) { prop.set(EbTool.jsonDeserialize <T>(json)); } } return(prop); }
//----------------------------------------------------------------------------- public string getKey() { return(mPropDef.getKey()); }
//--------------------------------------------------------------------- internal void _addPropDef(PropDef prop_def) { mMapPropDef[prop_def.getKey()] = prop_def; }