//------------------------------------------------------------------------------ public SettingInfo(String settingName, DynamicSettingInfo dynamicSettingInfo) { this.SettingName = settingName; this.SettingValue = dynamicSettingInfo.SettingValue; this.SettingValueType = dynamicSettingInfo.SettingType; this.SettingDefaultValue = null; }
//------------------------------------------------------------------------------ public virtual void SetSetting <T>(string settingName, T settingValue) { lock (m_lockObject) { var fullSettingName = CorrectDynamicSettingName(settingName); var settingType = typeof(T); var settingInfo = new DynamicSettingInfo(settingValue, settingType); if (m_dynamicSettings.Contains(fullSettingName)) { m_dynamicSettings[fullSettingName] = settingInfo; } else { m_dynamicSettings.Add(fullSettingName, settingInfo); } } }
//------------------------------------------------------------------------------ public void Add(string fullSettingName, DynamicSettingInfo dynamicSettingInfo) { if (m_dynamicSettings.ContainsKey(fullSettingName)) { Debug.Assert(m_dynamicSettingsOrder.Contains(fullSettingName)); m_dynamicSettings[fullSettingName] = dynamicSettingInfo; } else { Debug.Assert(!m_dynamicSettingsOrder.Contains(fullSettingName)); m_dynamicSettings.Add(fullSettingName, dynamicSettingInfo); m_dynamicSettingsOrder.Add(fullSettingName); } if (m_dynamicSettingsCustomOrder != null) { m_dynamicSettingsCustomOrder.Add(fullSettingName); } }
//------------------------------------------------------------------------------ public bool TryGetValue(string fullSettingName, out DynamicSettingInfo value) { return(m_dynamicSettings.TryGetValue(fullSettingName, out value)); }