public void OnQuit()
 {
     Dispatcher.Invoke(() =>
     {
         MessageBox.Show("Przeciwnik opuscil gre, Wygrales :)");
         Window window = new StartWindow(App.LastNick);
         window.Show();
         this.Close();
     });
 }
        public MainWindow(string nickname, StartWindow window)
        {
            InitializeComponent();
            //ShowConnect(true);

            ShowAll(false);
            waiterTimer           = new System.Timers.Timer(150);
            waiterTimer.Enabled   = true;
            waiterTimer.AutoReset = true;
            waiterTimer.Elapsed  += OnTimer;
            startWindow           = window;
            eng      = new Engine(this, nickname);
            IsClosed = false;
            eng.Start();
        }
Example #3
0
 private void ShowWinner(int value)
 {
     wnd.Dispatcher.Invoke(() =>
     {
         if (value == index)
         {
             MessageBox.Show("Wygrales :)");
         }
         else
         {
             MessageBox.Show("Przegrales :(");
         }
         Window window = new StartWindow(App.LastNick);
         window.Show();
         wnd.Close();
     });
 }