Exemplo n.º 1
0
 private void button1_Click(object sender, EventArgs e)
 {
     if (string.IsNullOrEmpty(this.ChoosenName))
     {
         string name       = "";
         var    chooseName = new NameChooser(ref name);
         chooseName.ShowDialog();
         this.ChoosenName = chooseName.ChoosenName;
         btn_send.Text    = "Connecting...";
         Connect(this.ChoosenName);
         return;
     }
     HubProxy.Invoke("AddMessage", this.ChoosenName, textBox1.Text);
     textBox1.Text = String.Empty;
     textBox1.Focus();
 }
Exemplo n.º 2
0
 public void Connect(string name)
 {
     btn_send.Enabled = false;
     HubProxy.Invoke("Connect", name);
 }