private void Window_Loaded(object sender, RoutedEventArgs e) { if (Status.isAutoChandeTheme) { btnAutoNightMode.IsChecked = Status.isAutoChandeTheme; autoNightMode(); } else { ConfigXmlPassage xml = new ConfigXmlPassage(Configure.Config.ConfigXmlPath); if (xml.GetTheme().Equals(Xml.XmlContext.Theme.Dark)) { Status.isDark = true; ThemePassage.ThemeConvert(Theme.Dark); } else { Status.isDark = false; ThemePassage.ThemeConvert(Theme.Light); } } ThemePassage.IsCheckedLoad(); new Languages.ControlLoad().Loaded(this); Data.AddAppLog("application runing"); }
private void btnLanguage_Click(object sender, RoutedEventArgs e) { var xml = new ConfigXmlPassage(Config.ConfigXmlPath); switch (comboLanguage.Text) { case "English": xml.SetLanguage(Languages.In.Region.English);break; case "中文": xml.SetLanguage(Languages.In.Region.China);break; default: throw new Exception("language erroe"); } }
private void Window_Closed(object sender, EventArgs e) { ConfigXmlPassage xml = new ConfigXmlPassage(Configure.Config.ConfigXmlPath); if (Status.isDark) { xml.SetTheme(Xml.XmlContext.Theme.Dark); } else { xml.SetTheme(Xml.XmlContext.Theme.Light); } Data.AddAppLog("application close"); if (Setting.AutoExportLog) { ShowLogWindow.ExportFile(); } SetFile.ExportFile(); Process.GetCurrentProcess().Kill(); }