public static void Save()
 {
     CloseLauncherAutomaticallyKey.SetValue(CloseLauncherAutomatically);
     ActiveVersionKey.SetValue(ActiveVersion);
     CurrentTabKey.SetValue(CurrentTab);
     SettingsContainer.SaveSettingsProfile(SettingsContainer.CurrentProfile, LauncherConfigPath);
 }
Ejemplo n.º 2
0
        public bool Save()
        {
            if (package.FullPath == null)
            {
                return(false);
            }

            var path = package.FullPath + SettingsExtension;

            return(SettingsContainer.SaveSettingsProfile(profile, path));
        }
Ejemplo n.º 3
0
        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));
        }
Ejemplo n.º 4
0
        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" });
        }
Ejemplo n.º 5
0
 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();
 }
Ejemplo n.º 6
0
 public static void Save()
 {
     SettingsContainer.SaveSettingsProfile(profile, EditorPath.EditorConfigPath);
 }
Ejemplo n.º 7
0
 /// <summary>
 /// Saves the settings into the settings file.
 /// </summary>
 public static void WriteFile()
 {
     SettingsContainer.SaveSettingsProfile(Profile, EditorPath.InternalConfigPath);
 }