} //用户此次的用户名 private DataCore() { mDataMap = new Dictionary <string, ObservableCollection <ChatMsg> >(); ConListBinding = new ObservableCollection <LocalConversation>(); ChatMsgListBinding = new ObservableCollection <ChatMsg>(); MarsPushMgr.addObserver((int)CgiCmdID.CgiCmdID_PushMsg, this); }
public ConversationPage() { this.InitializeComponent(); NavigationCacheMode = NavigationCacheMode.Enabled; MarsPushMgr.addObserver((int)CgiCmdID.CgiCmdID_ConvList, this); this.DataContext = DataCore.getInstance(); refreshList(); }
public void OnPush(int cmdid, byte[] msgpayload) { MessagePush msgPush = MessagePush.ParseFrom(msgpayload); ChatMsg localMsg = new ChatMsg(); localMsg.ConversationId = msgPush.Topic; localMsg.From = msgPush.From; localMsg.IsComMeg = true; localMsg.Message = msgPush.Content; localMsg.Date = DateTime.Now.ToString(); MarsEventArgs args = new MarsEventArgs(); args.Code = EventConst.SUCCESS; args.Data = localMsg; MarsPushMgr.onPush(cmdid, args); return; }