private void tb_04_Tap(object sender, GestureEventArgs e) { TextBlock tapped = (TextBlock)sender; //Play(tapped); AsynchronousClient client = new AsynchronousClient(this.ServerName, this.PortNumber); if (checkServerName()) { client.SendData("3"); } }
/// <summary> /// Call the server asking for a move, passing the current board state /// </summary> /// <remarks>Communciation with the server is asynchronous. We await a response in /// the ResponseReceived handler</remarks> private void GetMoveFromServer() { LockGameboard(); // Package up the board state and send to the server so it can // make it's move string boardState = GetBoardState(); // Start the progress indicator SystemTray.ProgressIndicator.IsIndeterminate = true; SystemTray.ProgressIndicator.IsVisible = true; SystemTray.ProgressIndicator.Text = "Getting move from server"; /// Remove hard-coded port number AsynchronousClient client = new AsynchronousClient(this.ServerName, this.PortNumber); client.ResponseReceived += new ResponseReceivedEventHandler(ac_GotMove); _waitingOnServerMove = true; client.SendData(boardState); }
private void tb_04_Tap(object sender, GestureEventArgs e) { TextBlock tapped = (TextBlock)sender; //Play(tapped); AsynchronousClient client = new AsynchronousClient(this.ServerName, this.PortNumber); if (checkServerName()) client.SendData("3"); }