private void DeleteServer_Click(object sender, RoutedEventArgs e) { var selectedSrv = RootTabControl.SelectedIndex == 0 ? WindowsTabControl.SelectedItem : LinuxTabControl.SelectedItem; if (selectedSrv == null) { return; } SimpleForm form = new SimpleForm((Server)selectedSrv); form.ShowDialog(); if (!form.Result) { return; } if (selectedSrv is WindowsServer) { Config.DeleteServer((WindowsServer)WindowsTabControl.SelectedItem); } else { Config.DeleteServer((LinuxServer)LinuxTabControl.SelectedItem); } RefreshTabComtrols(); }
private void Delete_Click(object sender, RoutedEventArgs e) { SimpleForm form = new SimpleForm(Srv); form.ShowDialog(); if (!form.Result) { return; } if ((Boolean)srvType.IsChecked) { mainWindow.Config.DeleteServer((LinuxServer)this.OldSrv); } else { mainWindow.Config.DeleteServer((WindowsServer)this.OldSrv); } this.Close(); }