private void NameText_TextChanged(object sender, EventArgs e) { if (RoomClientForm.IsEmptyString(this.NameText.Text)) { this.OK_Button.Enabled = false; } else { this.OK_Button.Enabled = true; } }
private void SendButton_Click(object sender, EventArgs e) { if (!RoomClientForm.IsEmptyString(this.MessageText.Text)) { string message = string.Format("{0} : {1}", this._myName, this.MessageText.Text); if (this._client.Chat(this._target, message)) { this.AppendText(message); this.MessageText.Clear(); } else { this.AppendText("对方已经不再房间中."); } } }