public static void Save() { CloseLauncherAutomaticallyKey.SetValue(CloseLauncherAutomatically); ActiveVersionKey.SetValue(ActiveVersion); CurrentTabKey.SetValue(CurrentTab); SettingsContainer.SaveSettingsProfile(SettingsContainer.CurrentProfile, LauncherConfigPath); }
public bool Save() { if (package.FullPath == null) { return(false); } var path = package.FullPath + SettingsExtension; return(SettingsContainer.SaveSettingsProfile(profile, path)); }
public bool Save() { if (package.FullPath == null) { return(false); } var path = Path.Combine(package.FullPath.GetFullDirectory(), package.FullPath.GetFileName() + SettingsExtension); return(SettingsContainer.SaveSettingsProfile(profile, path)); }
public void TestSettingsSaveAndLoad() { TestSettingsWrite(); TestSettingsList(); SettingsContainer.SaveSettingsProfile(SettingsContainer.CurrentProfile, TempPath("TestSettingsSaveAndLoad.txt")); SettingsContainer.LoadSettingsProfile(TempPath("TestSettingsSaveAndLoad.txt"), true); Assert.Equal(30, ValueSettingsKeys.IntValue.GetValue()); Assert.Equal(9.1, ValueSettingsKeys.DoubleValue.GetValue()); Assert.Equal("Another string", ValueSettingsKeys.StringValue.GetValue()); var intList = ListSettingsKeys.IntList.GetValue(); Assert.Equal(intList, new[] { 1, 3 }); var doubleList = ListSettingsKeys.DoubleList.GetValue(); Assert.Equal(doubleList, new[] { 9.0 }); var stringList = ListSettingsKeys.StringList.GetValue(); Assert.Equal(stringList, new[] { "String 1", "String 1.5", "String 2.0", "String 3" }); }
static GameStudioSettings() { MRU = new MostRecentlyUsedFileCollection(() => InternalSettingsContainer.LoadSettingsProfile(GetLatestInternalConfigPath(), false, null, false), MostRecentlyUsedSessionsKey, () => InternalSettingsContainer.SaveSettingsProfile(InternalSettingsContainer.CurrentProfile, GetLatestInternalConfigPath())); MostRecentlyUsedSessionsKey.FallbackDeserializers.Add(LegacyMRUDeserializer); InternalSettingsContainer.LoadSettingsProfile(GetLatestInternalConfigPath(), true); InternalSettingsContainer.CurrentProfile.MonitorFileModification = true; InternalSettingsContainer.CurrentProfile.FileModified += (sender, e) => { GameStudioSettingsFileChanged(sender, e); }; GameStudioProfile = GameStudioSettingsContainer.LoadSettingsProfile(GetLatestGameStudioConfigPath(), true); UpdateMostRecentlyUsed(); }
public static void Save() { SettingsContainer.SaveSettingsProfile(profile, EditorPath.EditorConfigPath); }
/// <summary> /// Saves the settings into the settings file. /// </summary> public static void WriteFile() { SettingsContainer.SaveSettingsProfile(Profile, EditorPath.InternalConfigPath); }