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(); }
public void Connect(string name) { btn_send.Enabled = false; HubProxy.Invoke("Connect", name); }