Esempio n. 1
0
File: App.xaml.cs Progetto: bdr27/c-
        public App()
            : base()
        {
            // create long-lived objects
            handler = new MOCKMessageHandler();
            player1Window = new MainWindow();
            player1Window.Title = "Player1";
            player2Window = new MainWindow();
            player2Window.Title = "Player2";
            timer = new DispatcherTimer();
            timer.Interval = TimeSpan.FromSeconds(1);

            // wire up event handler
            player1Window.AddIPAddressMenuItemHandler(HandleIPAddressMenuItemForPlayer1);
            player2Window.AddIPAddressMenuItemHandler(HandleIPAddressMenuItemForPlayer2);
            player1Window.AddNameMenuItemHandler(HandleNameMenuItemForPlayer1);
            player2Window.AddNameMenuItemHandler(HandleNameMenuItemForPlayer2);
            player1Window.GameBoard.AddMouseHandler(HandleMouseEventForPlayer1);
            player2Window.GameBoard.AddMouseHandler(HandleMouseEventForPlayer2);

            // show the Views
            player1Window.Show();
            player2Window.Show();
            timer.Start();
        }
Esempio n. 2
0
File: App.xaml.cs Progetto: bdr27/c-
        private void wireHandlers(MainWindow playerWindow)
        {
            playerWindow.AddIPAddressMenuItemHandler(HandleIPAddressMenuItem);
            

            playerWindow.GameBoard.AddMouseHandler(HandleMouseEvent);
        }
Esempio n. 3
0
File: App.xaml.cs Progetto: bdr27/c-
        public App()
            : base()
        {
            // create long-lived objects
            handler = new MOCKMessageHandler();
            player1Window = new MainWindow();
            player1Window.Title = "Player1";
            player2Window = new MainWindow();
            player2Window.Title = "Player2";

            // wire up event handler
            player1Window.AddIPAddressMenuItemHandler(HandleIPAddressMenuItemForPlayer1);
            player2Window.AddIPAddressMenuItemHandler(HandleIPAddressMenuItemForPlayer2);
            player1Window.AddNameMenuItemHandler(HandleNameMenuItemForPlayer1);
            player2Window.AddNameMenuItemHandler(HandleNameMenuItemForPlayer2);
            player1Window.GameBoard.AddMouseHandler(HandleMouseEventForPlayer1);
            player2Window.GameBoard.AddMouseHandler(HandleMouseEventForPlayer2);

            // show the Views
            player1Window.Show();
            player2Window.Show();
        }