/// <summary> /// 显示收到的信息 /// </summary> /// <param name="msg"></param> private void ShowReceiveMsg(ChatMsgData msg) { ChatMsg chatmsg = new ChatMsg(); Contact_all.ForEach(p => { if (p is ChatUser) { if ((p as ChatUser).UserName == msg.From) { chatmsg.Image = (p as ChatUser).Icon; return; } } }); if (msg.Type == 9) { Paragraph imgper = new Paragraph(new Floater(new BlockUIContainer(msg.MsgImg))); chatmsg.Message.Blocks.Add(imgper); } else { StrToFlDoc(msg.Msg, chatmsg.Message); } chatmsg.FlowDir = FlowDirection.LeftToRight; chatmsg.TbColor = System.Windows.Media.Brushes.White; ChatList.Add(chatmsg); }
/// <summary> /// 显示收到的信息 /// </summary> /// <param name="msg"></param> private void ShowReceiveMsg(WeChatMsg msg) { ChatMsg chatmsg = new ChatMsg(); Contact_all.ForEach(p => { if (p is WeChatUser) { if ((p as WeChatUser).UserName == msg.From) { chatmsg.Image = (p as WeChatUser).Icon; return; } } }); chatmsg.Message = msg.Msg; chatmsg.FlowDir = FlowDirection.LeftToRight; chatmsg.TbColor = Brushes.White; ChatList.Add(chatmsg); }
/// <summary> /// 显示收到的信息 /// </summary> /// <param name="msg"></param> private void ShowReceiveMsg(WeChatMsg msg) { ChatMsg chatmsg = new ChatMsg(); Contact_all.ForEach(p => { if (p is WeChatUser) { if ((p as WeChatUser).UserName == msg.From) { chatmsg.Image = (p as WeChatUser).Icon; return; } } }); Paragraph par = new Paragraph(); StrToFlDoc(msg.Msg, chatmsg.Message, par); chatmsg.FlowDir = FlowDirection.LeftToRight; chatmsg.TbColor = System.Windows.Media.Brushes.White; ChatList.Add(chatmsg); }