This commit is contained in:
12
App.xaml.cs
12
App.xaml.cs
@@ -1,4 +1,5 @@
|
||||
using System;
|
||||
using System.Configuration;
|
||||
using System.Diagnostics;
|
||||
using System.IO;
|
||||
using System.Security.Principal;
|
||||
@@ -53,6 +54,17 @@ namespace ShanghaiEnvironmentalTechnology
|
||||
RestartAsAdmin();
|
||||
Shutdown();
|
||||
}
|
||||
|
||||
// 加载保存的语言
|
||||
string savedLanguage = ConfigurationManager.AppSettings["Language"] ?? "zh-CN";
|
||||
var resourceDict = new ResourceDictionary
|
||||
{
|
||||
Source = new Uri($"/Resources/Strings.{savedLanguage}.xaml", UriKind.Relative)
|
||||
};
|
||||
|
||||
Current.Resources.MergedDictionaries.Clear();
|
||||
Current.Resources.MergedDictionaries.Add(resourceDict);
|
||||
|
||||
}
|
||||
|
||||
private bool IsRunAsAdmin()
|
||||
|
||||
Reference in New Issue
Block a user