Ejemplo n.º 1
0
 /// <summary>
 /// 发送信息函数
 /// </summary>
 /// <param name="objectMessage"></param>
 public void SendMessage(object objectMessage)
 {
     if (WaitSendContent == "" || CurrentUser == "" || ChatingWith == "")
     { return; }
     SendMessageImport import = new SendMessageImport
     {
         Content = WaitSendContent,
         From = CurrentUser,
         To = ChatingWith
     };
     chatClient.SendMessageAsync(import);
     WaitSendContent = "";
 }
Ejemplo n.º 2
0
 void SendNewMessage(object parameter)
 {
     if (TargetUser == "" || !Users.Any(x => x.Username == TargetUser))
     {
         IPop<string> pop = ViewModelService.Current.GetPop(Pop.ErrorPrompt) as IPop<string>;
         pop.State = "请先指定你要对话的用户";
         pop.Show();
         return;
     }
     if (MessageValue == "") { return; }
     SendMessageImport import = new SendMessageImport
     {
         From = Username,
         To = TargetUser,
         Content = MessageValue
     };
     chatClient.SendMessageAsync(import);
     MessageValue = "";
 }