public static void InitDefault() { // Init new Settings with default data Current = new SettingsInfo { SettingsChanged = true }; }
public static void Reset() { // Init new Settings with default data Current = new SettingsInfo() { SettingsChanged = true }; ForceRestart = true; }
public static void Load() { var filePath = GetSettingsFilePath(); if (File.Exists(filePath) && !CommandLineManager.Current.ResetSettings) { Current = DeserializeFromFile(filePath); Current.SettingsChanged = false; } else { Current = new SettingsInfo(); } }
public static void Load() { if (File.Exists(GetSettingsFilePath()) && !CommandLineManager.Current.ResetSettings) { SettingsInfo settingsInfo; var xmlSerializer = new XmlSerializer(typeof(SettingsInfo)); using (var fileStream = new FileStream(GetSettingsFilePath(), FileMode.Open)) { settingsInfo = (SettingsInfo)xmlSerializer.Deserialize(fileStream); } Current = settingsInfo; // Set the setting changed to false after loading them from a file... Current.SettingsChanged = false; } else { Current = new SettingsInfo(); } }