コード例 #1
0
 public static void Save()
 {
     CloseLauncherAutomaticallyKey.SetValue(CloseLauncherAutomatically);
     ActiveVersionKey.SetValue(ActiveVersion);
     CurrentTabKey.SetValue(CurrentTab);
     SettingsContainer.SaveSettingsProfile(SettingsContainer.CurrentProfile, LauncherConfigPath);
 }
コード例 #2
0
ファイル: PackageUserSettings.cs プロジェクト: Beefr/xenko-wd
        public bool Save()
        {
            if (package.FullPath == null)
            {
                return(false);
            }

            var path = package.FullPath + SettingsExtension;

            return(SettingsContainer.SaveSettingsProfile(profile, path));
        }
コード例 #3
0
ファイル: PackageUserSettings.cs プロジェクト: tiomke/paradox
        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));
        }
コード例 #4
0
ファイル: TestSettings.cs プロジェクト: Aggror/Stride
        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" });
        }
コード例 #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();
 }
コード例 #6
0
 public static void Save()
 {
     SettingsContainer.SaveSettingsProfile(profile, EditorPath.EditorConfigPath);
 }
コード例 #7
0
 /// <summary>
 /// Saves the settings into the settings file.
 /// </summary>
 public static void WriteFile()
 {
     SettingsContainer.SaveSettingsProfile(Profile, EditorPath.InternalConfigPath);
 }