예제 #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);
 }