diff --git a/src/MaaWpfGui/ViewModels/UI/AnnouncementViewModel.cs b/src/MaaWpfGui/ViewModels/UI/AnnouncementViewModel.cs index eeeb6ee553..0fb1e3ccb1 100644 --- a/src/MaaWpfGui/ViewModels/UI/AnnouncementViewModel.cs +++ b/src/MaaWpfGui/ViewModels/UI/AnnouncementViewModel.cs @@ -26,7 +26,7 @@ namespace MaaWpfGui.ViewModels.UI // ReSharper disable once ClassNeverInstantiated.Global public class AnnouncementViewModel : Screen { - private string _announcementInfo = ConfigurationHelper.GetValue(ConfigurationKeys.AnnouncementInfo, string.Empty); + private string _announcementInfo = ConfigurationHelper.GetGlobalValue(ConfigurationKeys.AnnouncementInfo, string.Empty); /// /// Gets the announcement info. @@ -38,11 +38,11 @@ namespace MaaWpfGui.ViewModels.UI private set { SetAndNotify(ref _announcementInfo, value); - ConfigurationHelper.SetValue(ConfigurationKeys.AnnouncementInfo, value); + ConfigurationHelper.SetGlobalValue(ConfigurationKeys.AnnouncementInfo, value); } } - private bool _doNotRemindThisAnnouncementAgain = Convert.ToBoolean(ConfigurationHelper.GetValue(ConfigurationKeys.DoNotRemindThisAnnouncementAgain, bool.FalseString)); + private bool _doNotRemindThisAnnouncementAgain = Convert.ToBoolean(ConfigurationHelper.GetGlobalValue(ConfigurationKeys.DoNotRemindThisAnnouncementAgain, bool.FalseString)); public bool DoNotRemindThisAnnouncementAgain { @@ -50,11 +50,11 @@ namespace MaaWpfGui.ViewModels.UI set { SetAndNotify(ref _doNotRemindThisAnnouncementAgain, value); - ConfigurationHelper.SetValue(ConfigurationKeys.DoNotRemindThisAnnouncementAgain, value.ToString()); + ConfigurationHelper.SetGlobalValue(ConfigurationKeys.DoNotRemindThisAnnouncementAgain, value.ToString()); } } - private bool _doNotShowAnnouncement = Convert.ToBoolean(ConfigurationHelper.GetValue(ConfigurationKeys.DoNotShowAnnouncement, bool.FalseString)); + private bool _doNotShowAnnouncement = Convert.ToBoolean(ConfigurationHelper.GetGlobalValue(ConfigurationKeys.DoNotShowAnnouncement, bool.FalseString)); /// /// Gets or sets a value indicating whether to show the update. @@ -65,7 +65,7 @@ namespace MaaWpfGui.ViewModels.UI set { SetAndNotify(ref _doNotShowAnnouncement, value); - ConfigurationHelper.SetValue(ConfigurationKeys.DoNotShowAnnouncement, value.ToString()); + ConfigurationHelper.SetGlobalValue(ConfigurationKeys.DoNotShowAnnouncement, value.ToString()); } } diff --git a/src/MaaWpfGui/ViewModels/UI/VersionUpdateViewModel.cs b/src/MaaWpfGui/ViewModels/UI/VersionUpdateViewModel.cs index 78eceb9b1f..3655ec5c5e 100644 --- a/src/MaaWpfGui/ViewModels/UI/VersionUpdateViewModel.cs +++ b/src/MaaWpfGui/ViewModels/UI/VersionUpdateViewModel.cs @@ -68,7 +68,7 @@ namespace MaaWpfGui.ViewModels.UI private readonly string _curVersion = Marshal.PtrToStringAnsi(MaaService.AsstGetVersion()) ?? "0.0.1"; private string _latestVersion = string.Empty; - private string _updateTag = ConfigurationHelper.GetValue(ConfigurationKeys.VersionName, string.Empty); + private string _updateTag = ConfigurationHelper.GetGlobalValue(ConfigurationKeys.VersionName, string.Empty); /// /// Gets or sets the update tag. @@ -79,11 +79,11 @@ namespace MaaWpfGui.ViewModels.UI set { SetAndNotify(ref _updateTag, value); - ConfigurationHelper.SetValue(ConfigurationKeys.VersionName, value); + ConfigurationHelper.SetGlobalValue(ConfigurationKeys.VersionName, value); } } - private string _updateInfo = ConfigurationHelper.GetValue(ConfigurationKeys.VersionUpdateBody, string.Empty); + private string _updateInfo = ConfigurationHelper.GetGlobalValue(ConfigurationKeys.VersionUpdateBody, string.Empty); // private static readonly MarkdownPipeline s_markdownPipeline = new MarkdownPipelineBuilder().UseXamlSupportedExtensions().Build(); @@ -107,7 +107,7 @@ namespace MaaWpfGui.ViewModels.UI set { SetAndNotify(ref _updateInfo, value); - ConfigurationHelper.SetValue(ConfigurationKeys.VersionUpdateBody, value); + ConfigurationHelper.SetGlobalValue(ConfigurationKeys.VersionUpdateBody, value); } } @@ -122,7 +122,7 @@ namespace MaaWpfGui.ViewModels.UI set => SetAndNotify(ref _updateUrl, value); } - private bool _isFirstBootAfterUpdate = Convert.ToBoolean(ConfigurationHelper.GetValue(ConfigurationKeys.VersionUpdateIsFirstBoot, bool.FalseString)); + private bool _isFirstBootAfterUpdate = Convert.ToBoolean(ConfigurationHelper.GetGlobalValue(ConfigurationKeys.VersionUpdateIsFirstBoot, bool.FalseString)); /// /// Gets or sets a value indicating whether it is the first boot after updating. @@ -133,11 +133,11 @@ namespace MaaWpfGui.ViewModels.UI set { SetAndNotify(ref _isFirstBootAfterUpdate, value); - ConfigurationHelper.SetValue(ConfigurationKeys.VersionUpdateIsFirstBoot, value.ToString()); + ConfigurationHelper.SetGlobalValue(ConfigurationKeys.VersionUpdateIsFirstBoot, value.ToString()); } } - private string _updatePackageName = ConfigurationHelper.GetValue(ConfigurationKeys.VersionUpdatePackage, string.Empty); + private string _updatePackageName = ConfigurationHelper.GetGlobalValue(ConfigurationKeys.VersionUpdatePackage, string.Empty); /// /// Gets or sets the name of the update package. @@ -148,7 +148,7 @@ namespace MaaWpfGui.ViewModels.UI set { SetAndNotify(ref _updatePackageName, value); - ConfigurationHelper.SetValue(ConfigurationKeys.VersionUpdatePackage, value); + ConfigurationHelper.SetGlobalValue(ConfigurationKeys.VersionUpdatePackage, value); } } @@ -421,7 +421,7 @@ namespace MaaWpfGui.ViewModels.UI Native, } - private bool _doNotShowUpdate = Convert.ToBoolean(ConfigurationHelper.GetValue(ConfigurationKeys.VersionUpdateDoNotShowUpdate, bool.FalseString)); + private bool _doNotShowUpdate = Convert.ToBoolean(ConfigurationHelper.GetGlobalValue(ConfigurationKeys.VersionUpdateDoNotShowUpdate, bool.FalseString)); /// /// Gets or sets a value indicating whether to show the update. @@ -432,7 +432,7 @@ namespace MaaWpfGui.ViewModels.UI set { SetAndNotify(ref _doNotShowUpdate, value); - ConfigurationHelper.SetValue(ConfigurationKeys.VersionUpdateDoNotShowUpdate, value.ToString()); + ConfigurationHelper.SetGlobalValue(ConfigurationKeys.VersionUpdateDoNotShowUpdate, value.ToString()); } }