private void btnRemoveSettings_Click(object sender, RoutedEventArgs e) { MiscOperations.SetRegistryStartup(false); MiscOperations.RemoveConfig(); WinForms.Application.Exit(); System.Diagnostics.Process.GetCurrentProcess().Kill(); }
public App() { this.Startup += App_Startup; this.Exit += App_Exit; // TODO search on up to date solution ServicePointManager.Expect100Continue = true; ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12; // Init ConfigMgnr var test = ConfigMgnr.I.ConfigPath; MiscOperations.CreateStreamLaunchFile(ConfigMgnr.I.FolderPath); MiscOperations.CreateFavoriteConfig(ConfigMgnr.I.FolderPath); MiscOperations.SetRegistryStartup(ConfigMgnr.I.StartWithWindows); // Dynamically set colors from config try { if (!ConfigMgnr.I.Color_MainPanel.Equals("0")) { Resources["Color_MainPanel"] = (SolidColorBrush)(new BrushConverter().ConvertFrom(ConfigMgnr.I.Color_MainPanel)); } if (!ConfigMgnr.I.Color_SubPanel.Equals("0")) { Resources["Color_SubPanel"] = (SolidColorBrush)(new BrushConverter().ConvertFrom(ConfigMgnr.I.Color_SubPanel)); } if (!ConfigMgnr.I.Color_DefaultText.Equals("0")) { Resources["Color_DefaultText"] = (SolidColorBrush)(new BrushConverter().ConvertFrom(ConfigMgnr.I.Color_DefaultText)); } if (!ConfigMgnr.I.Color_Highlight.Equals("0")) { Resources["Color_Highlight"] = (SolidColorBrush)(new BrushConverter().ConvertFrom(ConfigMgnr.I.Color_Highlight)); } if (!ConfigMgnr.I.Color_BtnBG.Equals("0")) { Resources["Color_BtnBG"] = (SolidColorBrush)(new BrushConverter().ConvertFrom(ConfigMgnr.I.Color_BtnBG)); } } catch (Exception) { // Should be fine :) } }
private void chkWin_Checked(object sender, RoutedEventArgs e) { ConfigMgnr.I.StartWithWindows = (bool)chkWin.IsChecked; MiscOperations.SetRegistryStartup((bool)chkWin.IsChecked); }