Reset() public method

public Reset ( ) : void
return void
コード例 #1
0
        /// <summary>
        /// Loads config on program start
        /// </summary>
        public void Load()
        {
            if (!Directory.Exists(CfgFolderPath))
            {
                Directory.CreateDirectory(CfgFolderPath);
            }

            if (File.Exists(CfgFilePath))
            {
                _settings.Reset();

                try {
                    Read();
                } catch {
                    Save();
                    throw;
                }
            }

            try {
                _settings.Validate();
            } catch (ArgumentNullException) {
                // There were missing config fields. Regenerate it and read it in
                Save();
                Read();

                _settings.Validate();
            }
        }
コード例 #2
0
ファイル: Config.cs プロジェクト: nibbydev/Exiled-Presence
 /// <summary>
 /// Recreates the config with default values
 /// </summary>
 public void Reset()
 {
     _settings.Reset();
     Save();
 }