Exemplo n.º 1
0
        // 可反复调用
        public static void SaveConfig()
        {
#if NO
            // Save the configuration file.
            if (_config != null)
            {
                _config.Save();
                _config = null;
            }
#endif
            // Save the configuration file.
            if (_config != null && _config.Changed == true)
            {
                _config.Save();
            }
        }
Exemplo n.º 2
0
        public bool Finish()
        {
            string strError = "";

            if (string.IsNullOrEmpty(this.DataDir))
            {
                strError = "this.DataDir 不应为空";
                goto ERROR1;
            }

            // Save the configuration file.
            if (_config != null)
            {
                _config.Set("default", "data_dir", this.DataDir);
                _config.Save();
                _config = null;
            }

            // 删除备份数据目录
            if (string.IsNullOrEmpty(this.ShadowDataDir) == false)
            {
                PathUtil.DeleteDirectory(this.ShadowDataDir);
            }
            return(true);

ERROR1:
            MessageBox.Show(this, strError);
            return(false);
        }
Exemplo n.º 3
0
 // 允许反复调用
 public static void SaveConfig()
 {
     // Save the configuration file.
     if (_config != null && _config.Changed)
     {
         _config.Save();
     }
 }
Exemplo n.º 4
0
        protected static void SaveNodeAction(IConfigurationNode node)
        {
            ConfigSetting cs = node.ConfigObj as ConfigSetting;

            if (cs != null)
            {
                cs.Save();
            }
        }
Exemplo n.º 5
0
 public static void SaveConfig()
 {
     // Save the configuration file.
     if (_config != null)
     {
         _config.Save();
         _config = null;
     }
 }
Exemplo n.º 6
0
        // 允许反复调用
        public static void SaveConfig(delegate_fileCreated func_fileCreated)
        {
            // Save the configuration file.
            if (_config != null && _config.Changed)
            {
                bool exists = string.IsNullOrEmpty(_config.FileName) == false && File.Exists(_config.FileName);

                _config.Save();

                // 首次创建文件
                if (exists == false &&
                    string.IsNullOrEmpty(_config.FileName) == false && File.Exists(_config.FileName))
                {
                    func_fileCreated?.Invoke(_config.FileName);
                }
            }
        }
 /// <summary>
 /// Saves the associated config setting.
 /// </summary>
 public void Save()
 {
     UpdateSetting();
     _setting.Save();
 }