Ejemplo n.º 1
0
        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);
        }
Ejemplo n.º 2
0
        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)));
        }
Ejemplo n.º 3
0
 public void OnNewSessionStarted(ConnectDialog connectDialog)
 {
     this.MainWindowContainer.Children.Clear();
     this.StartNewSessionAndCreateUI(connectDialog);
 }
Ejemplo n.º 4
0
        private void StartNewSessionAndCreateUI(ConnectDialog connectDialog)
        {
            ServerSession newSession = new ServerSession(connectDialog.ConnectionDetails);

            this.Dispatcher.Invoke((Action)(() => this.MainWindowContainer.Children.Add((UIElement) new ServerControl(newSession))));
        }