Пример #1
0
        public void SaveCurrentConfig()
        {
            //Check if the file has somehow became read-only
            FileInfo newFileInfo = new FileInfo(configPath);

            if (newFileInfo.Exists)
            {
                if ((newFileInfo.Attributes & FileAttributes.ReadOnly) > 0)
                {
                    newFileInfo.Attributes ^= FileAttributes.ReadOnly;
                }
            }
            else
            {
                //Reset();
                Config config = new Config();
                config.Save(configPath);
            }

            currentConfig.Save(configPath);
        }
Пример #2
0
        public void ApplyDefault()
        {
            Config config;

            if (File.Exists(configPath))
            {
                config = Config.LoadFrom(configPath);
            }
            else
            {
                config = new Config();
                config.Save(configPath);
            }

            Apply(config);
        }
Пример #3
0
        public void Reset()
        {
            Config config = new Config();
            config.Save(configPath);

            Apply(config);
        }