コード例 #1
0
ファイル: GameWindow.xaml.cs プロジェクト: ricardorzan/domino
        private void ClickIconChat(object sender, EventArgs e)
        {
            string message = TextBoxChat.Text;

            if (!string.IsNullOrEmpty(message))
            {
                serverChat.SendMessage(GameId, message);

                string format = "\n" + Properties.Resources.You + ": " + message;
                ChatBox.AppendText(format);
                ChatBox.ScrollToEnd();
                TextBoxChat.Clear();
            }
        }
コード例 #2
0
        private void buttonTest_Click(object sender, EventArgs e)
        {
            InstanceContext context = new InstanceContext(new MyCallback());

            Proxy.ChatServiceClient server = new Proxy.ChatServiceClient(context);

            var message = TextBoxChat.Text;

            if (!string.IsNullOrEmpty(message))
            {
                server.SendMessage(message);
            }
            LabelTextChat.Content += "\n " + "Tu : " + message;
            TextBoxChat.Clear();
        }
コード例 #3
0
        private void ClickIconChat(object sender, EventArgs e)
        {
            string message = TextBoxChat.Text;

            if (!string.IsNullOrEmpty(message))
            {
                try
                {
                    server.SendMessage(0, message);

                    string format = "\n" + Properties.Resources.You + ": " + message;
                    ChatBox.AppendText(format);
                    ChatBox.ScrollToEnd();
                    TextBoxChat.Clear();
                }
                catch (CommunicationObjectFaultedException ex)
                {
                    Console.WriteLine(ex.ToString());
                    LabelAlert.Content = Properties.Resources.ServerIsOff;
                }
            }
        }