示例#1
0
 private void GetKey(object sender, KeyEventArgs e)
 {
     if (e.Key == Key.Enter)
     {
         ChatTb.Focus();
     }
 }
示例#2
0
 private void PushMessage(string Content, string FromName)
 {
     Content = Content.Replace("<br />", "\r\n"); //convert from HTML to Textbox's text
     CreateMessage(Content, FromName);
     ChatTb.Text = "";
     ChatTb.Focus();
 }
示例#3
0
 private void GameInit()
 {
     PlayPanel.Children.Clear();
     CreatePlayGround();
     ChatTb.Focus();
     MyName = NameTb.Text;
     if (Board.CurrentMode == PlayMode.Online || Board.CurrentMode == PlayMode.MachineVsOnline)
     {
         GomokuSocket = IO.Socket(WebConfigurationManager.AppSettings.Get("ServerAddress"));
         InitConnect();     //Initialize Connect
         ChatConnect();     //Create Thread for chatting
         GamePlayConnect(); //Create Threads for playing
     }
 }
示例#4
0
        private void NameChanged_Click(object sender, RoutedEventArgs e)
        {
            if (!isConnectedToPeople && Connected)
            {
                GomokuSocket.Emit("ConnectToOtherPlayer");
                ((Button)sender).Content = "Change!";
                isConnectedToPeople      = true;
            }
            else
            {
                ChatTb.Focus();
            }
            MyName = NameTb.Text;

            GomokuSocket.Emit("MyNameIs", MyName);
        }