Example #1
0
        private void btnSendMessage_Click(object sender, EventArgs e)
        {
            var selectedItem = lstClientList.SelectedItem;

            if (selectedItem == null)
            {
                MessageBox.Show("请选择需要客户端");
                return;
            }
            if (string.IsNullOrEmpty(txtMessage.Text))
            {
                MessageBox.Show("请输入消息内容");
                return;
            }
            var message = new MessageEntity
            {
                Receiver    = selectedItem.ToString(),
                MessageType = MessageTypes.Default,
                Content     = txtMessage.Text,
            };

            MessageServiceManager.PushMessage(message);
        }
Example #2
0
 public void PushMessage(MessageEntity message)
 {
     MessageServiceManager.PushMessage(message);
 }