Пример #1
0
        public virtual void Set(string key, object value)
        {
            value.ShouldNotBeNull("value");

            if (Get(key) == null)
            {
                Add(key, value.ToString());
            }
            else
            {
                keys[key] = value.ToString();
            }

            if (ConfigSource.AutoSave)
            {
                ConfigSource.Save();
            }

            OnKeySet(new ConfigKeyEventArgs(key, value.ToString()));
        }
Пример #2
0
        /// <include file='IConfig.xml' path='//Method[@name="Set"]/docs/*' />
        public virtual void Set(string key, object value)
        {
            if (value == null)
            {
                throw new ArgumentNullException("Value cannot be null");
            }

            if (Get(key) == null)
            {
                this.Add(key, value.ToString());
            }
            else
            {
                keys[key] = value.ToString();
            }

            if (ConfigSource.AutoSave)
            {
                ConfigSource.Save();
            }

            OnKeySet(new ConfigKeyEventArgs(key, value.ToString()));
        }
Пример #3
0
 public bool Save(string uri)
 {
     ConfigSource.Save(uri);
     return(false);
 }
Пример #4
0
 public void SaveConfigFile()
 {
     ConfigSource.Save(FullConfigPath);
 }