private void OnReconnectClicked(object sender, RoutedEventArgs routedEventArgs) { ConnectDialog connectDialog = new ConnectDialog(this.m_serverSession.ConnectionDetails); bool? nullable = connectDialog.ShowDialog(); bool flag = true; if ((nullable.GetValueOrDefault() == flag ? (nullable.HasValue ? 1 : 0) : 0) == 0) { return; } (Application.Current.MainWindow as MainWindow).OnNewSessionStarted(connectDialog); }
public MainWindow() { this.InitializeComponent(); this.Title = this.Title + " v" + this.VersionString(); RconStaticLibrary.UpdateAvailableCommandsAndGetters(); ConnectDialog connectDialog = new ConnectDialog(new ServerConnectionDetails()); bool? nullable = connectDialog.ShowDialog(); bool flag = false; if ((nullable.GetValueOrDefault() == flag ? (nullable.HasValue ? 1 : 0) : 0) != 0) { this.Close(); } Task.Run((Action)(() => this.StartNewSessionAndCreateUI(connectDialog))); }
public void OnNewSessionStarted(ConnectDialog connectDialog) { this.MainWindowContainer.Children.Clear(); this.StartNewSessionAndCreateUI(connectDialog); }
private void StartNewSessionAndCreateUI(ConnectDialog connectDialog) { ServerSession newSession = new ServerSession(connectDialog.ConnectionDetails); this.Dispatcher.Invoke((Action)(() => this.MainWindowContainer.Children.Add((UIElement) new ServerControl(newSession)))); }