private void button_send_Click(object sender, EventArgs e) { try { ChatBoxContent content = this.chatBox_send.GetContent(); if (content.IsEmpty()) { return; } byte[] buff = CompactPropertySerializer.Default.Serialize(content); this.AppendChatBoxContent(this.userID, content, Color.SeaGreen); //广播消息给组友 this.groupOutter.Broadcast(this.groupID, InformationTypes.BroadcastChat, buff, ActionTypeOnChannelIsBusy.Continue); //清空输入框 this.chatBox_send.Clear(); this.chatBox_send.Focus(); } catch (Exception ee) { Program.Logger.Log(ee, "TextChatControl.button_send_Click", ESBasic.Loggers.ErrorLevel.High); MessageBox.Show(ee.Message); } }
private void btnSend_Click(object sender, EventArgs e) { ChatBoxContent content = this.chatBoxSend.GetContent(); //发送内容为空时,不做响应 if (content.IsEmpty()) { return; } SendMessage(content.Text); AddMessageToHistory(content); var message = new ChatMessage(_myUserName, _myDisplayName, _userName, content); GlobalVariable.SaveChatMessage(message); }
private void btnSend_Click(object sender, EventArgs e) { ChatBoxContent content = this.chatBoxSend.GetContent(); //发送内容为空时,不做响应 if (content.IsEmpty()) { return; } this.AppendChatBoxContent("乔克斯", null, content, Color.SeaGreen, false); //清空发送输入框 this.chatBoxSend.Text = string.Empty; this.chatBoxSend.Focus(); //请求小黄鸡回复 System.Threading.ThreadPool.QueueUserWorkItem((s) => GoChat(content.Text)); }
/// <summary> /// 发送信息 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void ibtnSend_Click(object sender, EventArgs e) { try { ChatBoxContent content = this.chatBoxSend.GetContent(); if (xmppSendMessageBtnClick != null) { xmppSendMessageBtnClick(content, FrendID); //Matrix.Xmpp.Client.Message msg = new Matrix.Xmpp.Client.Message(FrendID, content.Text, "", ""); //this.client.Send(msg); } if (content.IsEmpty()) { return; } bool followingWords = false; this.AppendChatBoxContent(MineID, null, content, Color.SeaGreen, followingWords); //清空输入框 this.chatBoxSend.Text = string.Empty; this.chatBoxSend.Focus(); } catch (Exception ee) { this.AppendSysMessage("发送消息失败!" + ee.Message); } }