예제 #1
0
 public void EditGame()
 {
     if (EditGameWindow.ShowDialog(Config.MainWindow, this))
     {
         Entry?.Update();
         Config.Modified = true;
         Config.SaveConfig();
     }
 }
예제 #2
0
        private void OnEdit(object sender, RoutedEventArgs e)
        {
            TreeViewItem item = treeView.SelectedItem as TreeViewItem;

            if (item != null && item != treeView.Items[0])
            {
                if (item.Tag is SetupFolder)
                {
                    if (EditFolderWindow.ShowDialog(Window.GetWindow(this), item.Tag as SetupFolder))
                    {
                        UpdateItem(item);
                        Modified = true;
                    }
                }
                else if (item.Tag is Game)
                {
                    if (EditGameWindow.ShowDialog(Window.GetWindow(this), item.Tag as Game))
                    {
                        UpdateItem(item);
                        Modified = true;
                    }
                }
                else if (item.Tag is Server)
                {
                    if (EditServerWindow.ShowDialog(Window.GetWindow(this), item.Tag as Server))
                    {
                        UpdateItem(item);
                        Modified = true;
                    }
                }
                else if (item.Tag is Tool)
                {
                    if (EditToolWindow.ShowDialog(Window.GetWindow(this), item.Tag as Tool))
                    {
                        UpdateItem(item);
                        Modified = true;
                    }
                }
                item.IsSelected = true;
                item.Focus();
            }
        }