Exemple #1
0
        void ConnectUser()
        {
            if (!isConnected)
            {
                client = new ServiceChatClient(new System.ServiceModel.InstanceContext(this));
                ID     = client.Connect(textBox2.Text);

                textBox2.Enabled = false;
                button1.Text     = "Выйти";
                var messages = client.ShowMsg(textBox2.Text);
                if (messages != null)
                {
                    foreach (var m in messages)
                    {
                        if (m != "")
                        {
                            listBox1.Items.Add(m);
                        }
                    }
                }
                isConnected = true;
            }
        }