Exemple #1
0
        //---------------------------------------------------------------------
        public Prop <T> defProp <T>(Dictionary <string, string> map_param, string key, T default_value)
        {
            PropDef prop_def = new PropDef(key, typeof(T));

            mMapPropDef[prop_def.getKey()] = prop_def;
            Prop <T> prop = new Prop <T>(prop_def, default_value);

            mMapProp[prop_def.getKey()] = prop;

            if (map_param != null && map_param.ContainsKey(prop_def.getKey()))
            {
                string json = map_param[prop_def.getKey()];
                if (!string.IsNullOrEmpty(json.Trim()))
                {
                    prop.set(EbJsonHelper.deserialize <T>(json));
                }
            }

            return(prop);
        }
Exemple #2
0
 //-----------------------------------------------------------------------------
 public string getKey()
 {
     return(mPropDef.getKey());
 }
Exemple #3
0
 //---------------------------------------------------------------------
 internal void _addPropDef(PropDef prop_def)
 {
     mMapPropDef[prop_def.getKey()] = prop_def;
 }