Пример #1
0
        }                                       //用户此次的用户名

        private DataCore()
        {
            mDataMap           = new Dictionary <string, ObservableCollection <ChatMsg> >();
            ConListBinding     = new ObservableCollection <LocalConversation>();
            ChatMsgListBinding = new ObservableCollection <ChatMsg>();
            MarsPushMgr.addObserver((int)CgiCmdID.CgiCmdID_PushMsg, this);
        }
Пример #2
0
        public ConversationPage()
        {
            this.InitializeComponent();
            NavigationCacheMode = NavigationCacheMode.Enabled;

            MarsPushMgr.addObserver((int)CgiCmdID.CgiCmdID_ConvList, this);
            this.DataContext = DataCore.getInstance();

            refreshList();
        }
Пример #3
0
        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;
        }