예제 #1
0
        public void Start()
        {
            if (_connected)
            {
                return;
            }

            _connected = true;

            try
            {
                _client = new TicTacToeClient(
                    new InstanceContext(_callback),
                    "NetTcpBinding_TicTacToe");
                _client.Open();

                _client.Register();
            }
            catch (Exception e)
            {
                Trace.TraceError("An exception occured: {0}", e.Message);
                _client?.Abort();
                _connected = false;
            }
        }
예제 #2
0
 public MainWindow()
 {
     InitializeComponent();
     headerPanel.Visibility     = Visibility.Visible;
     startGamePanel.Visibility  = Visibility.Collapsed;
     createUserPanel.Visibility = Visibility.Collapsed;
     player = new TicTacToeClient(new InstanceContext(new CallbackHandler(new List <Button> {
         A1, A2, A3, B1, B2, B3, C1, C2, C3
     })));
 }