private void initForm() { enginePipe.connect(); Invoke((MethodInvoker) delegate { lblWaiting.Visible = false; lblCurrentPlayer.Visible = true; label1.Visible = true; string s = enginePipe.getEngineMessage(); if (s.Length != (BOARD_SIZE * BOARD_SIZE + 1)) { MessageBox.Show("The length of the board's string is not according the PROTOCOL"); this.Close(); } else { isCurPlWhite = (s[s.Length - 1] == '0'); paintBoard(s); } }); }
private void initForm() { enginePipe.connect(); changePipe.connect(); chatPipe.connect(); Invoke((MethodInvoker) delegate { wait.Visible = true; lblWaiting.Visible = false; }); enginePipe.getEngineMessage(); Invoke((MethodInvoker) delegate { wait.Visible = false; lblCurrentPlayer.Visible = true; label1.Visible = true; chatBox.SelectionStart = chatBox.Text.Length; chatBox.ScrollToCaret(); this.msgBox.KeyPress += new System.Windows.Forms.KeyPressEventHandler(CheckEnterKeyPress); string s = enginePipe.getEngineMessage(); if (s.Length != (BOARD_SIZE * BOARD_SIZE + 1)) { MessageBox.Show("The length of the board's string is not according the PROTOCOL"); this.Close(); } else { isCurPlWhite = (s[s.Length - 1] == '0'); paintBoard(s); } }); }