Esempio n. 1
0
        public override void SetObjectValue(string sectionName, string keyName, object value)
        {
            IConfigKeyValuePair keyValue = _storeValues[sectionName][keyName];

            if (keyValue != null)
            {
                if (keyValue is ConfigKeyValuePairLong)
                {
                    RegistryHelper.SetRegValue(null, sectionName, keyName, (long)Convert.ChangeType(value, typeof(long)));
                }
                else if (keyValue is ConfigKeyValuePairInt)
                {
                    RegistryHelper.SetRegValue(null, sectionName, keyName, (int)Convert.ChangeType(value, typeof(int)));
                }
                else if (keyValue is ConfigKeyValuePairBool)
                {
                    RegistryHelper.SetRegValue(null, sectionName, keyName, (bool)Convert.ChangeType(value, typeof(bool)));
                }
                else
                {
                    RegistryHelper.SetRegValue(null, sectionName, keyName, (string)Convert.ChangeType(value, typeof(string)));
                }
            }
        }
Esempio n. 2
0
 internal override void InitializeToDefaultValues(IConfigKeyValuePair keyValue, string sectionName, string keyName)
 {
     RegistryHelper.SetRegValue(null, sectionName, keyName, keyValue.GetDefaultObjectValue());
 }