コード例 #1
0
        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            _model.InitModel((UInt32)gameField.ActualHeight, (UInt32)gameField.ActualWidth);

            // create observable collections.
            gameField.ItemsSource = _model.gameFields;
        }
コード例 #2
0
        private void SocketSetup_Click(object sender, RoutedEventArgs e)
        {
            SocketSetupWindow socketSetupWindow = new SocketSetupWindow();

            socketSetupWindow.ShowDialog();
            this.Title = this.Title + " " + socketSetupWindow.SocketData.LocalIPString + "@" + socketSetupWindow.SocketData.LocalPort.ToString();
            _model.SetLocalNetworkSettings(socketSetupWindow.SocketData.LocalPort, socketSetupWindow.SocketData.LocalIPString);
            _model.SetRemoteNetworkSettings(socketSetupWindow.SocketData.RemotePort, socketSetupWindow.SocketData.RemoteIPString);
            _model.InitModel();
        }
コード例 #3
0
        private void SetUp_Click(object sender, RoutedEventArgs e)
        {
            SocketSetupWindow socketSetupWindow = new SocketSetupWindow();

            socketSetupWindow.ShowDialog();

            SetUp.IsEnabled = false;
            Play.IsEnabled  = true;

            _model.SetLocalNetworkSettings(socketSetupWindow.SocketData.LocalPort, socketSetupWindow.SocketData.LocalIPString);
            _model.SetRemoteNetworkSettings(socketSetupWindow.SocketData.RemotePort, socketSetupWindow.SocketData.RemoteIPString);

            // initialize model and get the ball rolling
            _model.InitModel();
            // set title bar to be unique
            this.Title = this.Title + " " + socketSetupWindow.SocketData.LocalIPString + "@" + socketSetupWindow.SocketData.LocalPort.ToString();
        }
コード例 #4
0
        private void SocketSetup_Button_Click(object sender, RoutedEventArgs e)
        {
            // call up socket setup windows to get setup data
            SocketSetupWindow socketSetupWindow = new SocketSetupWindow();

            socketSetupWindow.ShowDialog();

            // set title bar to be unique
            this.Title = this.Title + " " + socketSetupWindow.SocketData.LocalIPString + "@" + socketSetupWindow.SocketData.LocalPort.ToString();

            // update model with setup data
            _model.SetLocalNetworkSettings(socketSetupWindow.SocketData.LocalPort, socketSetupWindow.SocketData.LocalIPString);
            _model.SetRemoteNetworkSettings(socketSetupWindow.SocketData.RemotePort, socketSetupWindow.SocketData.RemoteIPString);

            // initialize model and get the ball rolling
            _model.InitModel();
        }