CBaseParam GetBaseParam(SWindowParamDescr inParamDescr) { CBaseParam val; if (!_params.TryGetValue(inParamDescr.Id, out val)) { val = CBaseParam.CreateParam(inParamDescr.ParamType, null); //_params.Add(inParamDescr.Id, val); //_gui_realization.OnWindowChange(this, inParamDescr.Id, val); } return(val); }
internal void CheckChanging(SWinKeyInfo inKeyInfo, ILogPrinter inLogger) { CWindowTypeDescr type_descr = _window_type_descrs.GetDescr(WindowType); List <NamedId> unusing_params = new List <NamedId>(_params.Keys); foreach (SWindowParamDescr param_descr in type_descr) { if (param_descr == SWindowParamDescr.Name) { CheckParam(param_descr, new string[] { inKeyInfo.Name }); unusing_params.Remove(param_descr.Id); } else { bool must_be = type_descr.IsMustBe(param_descr.Id); string[] a = Utils.TryGetParamsByNameFromSubKey(param_descr.Id.Name, inKeyInfo.WinKey, inLogger, must_be, CBaseParam.GetParamCount(param_descr.ParamType)); if (a != null) { CheckParam(param_descr, a); unusing_params.Remove(param_descr.Id); } } } unusing_params.ForEach(id => { _params.Remove(id); SWindowParamDescr?pd = type_descr.GetWindowParamDescr(id); if (pd.HasValue) { CBaseParam def_val = CBaseParam.CreateParam(pd.Value.ParamType, null); OnWindowChange(pd.Value, def_val); } }); IKey childs_key = inKeyInfo.WinKey.FindChildByName("Childs", StringComparison.InvariantCultureIgnoreCase); if (childs_key != null) { Build(childs_key, inLogger); } }
void CheckParam(SWindowParamDescr inParamDescr, string[] inNewValue) { CBaseParam val; if (_params.TryGetValue(inParamDescr.Id, out val)) { if (val.SetValue(inNewValue)) { OnWindowChange(inParamDescr, val); } } else { val = CBaseParam.CreateParam(inParamDescr.ParamType, inNewValue); _params.Add(inParamDescr.Id, val); OnWindowChange(inParamDescr, val); } }