private void Settings() { SettingsWnd wnd = new SettingsWnd(); wnd.Owner = ServiceProvider.PluginManager.SelectedWindow as Window; wnd.ShowDialog(); try { RegistryKey rk = Registry.CurrentUser.OpenSubKey("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run", true); if (rk == null) return; if (ServiceProvider.Settings.StartupWithWindows) { rk.SetValue(Core.Classes.Settings.AppName, Assembly.GetExecutingAssembly().Location); } else rk.DeleteValue(Core.Classes.Settings.AppName, false); } catch (Exception ex) { ServiceProvider.WindowsManager.ExecuteCommand(WindowsCmdConsts.MainWnd_Message, "Usable to set startup\n"+ ex.Message); Log.Error("Usable to set startup", ex); } }
private void btn_settings_Click(object sender, RoutedEventArgs e) { if (PropertyWnd != null && PropertyWnd.IsVisible) PropertyWnd.Topmost = false; SettingsWnd wnd = new SettingsWnd(); wnd.ShowDialog(); if (PropertyWnd != null && PropertyWnd.IsVisible) PropertyWnd.Topmost = true; }