private void buttonEdit_Click(object sender, RoutedEventArgs e) { if (Tree.SelectedNode == null) { MessageBox.Show(Application.Current.MainWindow, "No entry selected", Utils.ProductName, MessageBoxButton.OK, MessageBoxImage.Error); return; } var selectedItem = Tree.SelectedNode.Tag as StartupEntry; // If root node -> display msg box and exit if (selectedItem != null && selectedItem.Children.Count > 0) { MessageBox.Show(Application.Current.MainWindow, "Entry cannot be registry key or folder", Utils.ProductName, MessageBoxButton.OK, MessageBoxImage.Information); return; } Main.Watcher.Event("Startup Manager", "Edit"); if (selectedItem == null) { return; } var addEditEntryWnd = new AddEditEntry(selectedItem.Parent.SectionName, selectedItem.SectionName, selectedItem.Path, selectedItem.Args, selectedItem.RegKey); if (addEditEntryWnd.ShowDialog().GetValueOrDefault()) { // Refresh treelistview LoadStartupFiles(); } }
private void buttonAdd_Click(object sender, RoutedEventArgs e) { Main.Watcher.Event("Startup Manager", "Add"); var addEditEntryWnd = new AddEditEntry(); if (addEditEntryWnd.ShowDialog().GetValueOrDefault()) { // Refresh treelistview LoadStartupFiles(); } }