Exemple #1
0
        void _cedaSubscribe_OnCedaMessage(com.adaptiveMQ2.message.Message msg)
        {
            //   MessageBox.Show("Receive Message...");
            CedaObject co = CedaObject.ToCedaObject(msg);

            listRes = MsgHelper.Deserialize <MonitorUserCount>(co.MessageBody, MsgSerializerType.Json);
            // MessageBox.Show(listRes.Time + "        listRes.Time  ");
            string str = string.Format("地址:{2}:{3}  Topic={0},MessageBody=\n{1}", co.Topic, co.MessageBody, ip, port);

            LogHelper.Info(str);
            //消息窗口显示E
            dealwith_msg(listRes);
        }
Exemple #2
0
        /**
         * 数据处理方法
         **/
        private void dealwith_msg(MonitorUserCount listR)
        {
            if (listR.Type.Equals("countuserall"))
            {
                label_for_UserCount.Text = listR.Num + "";
            }
            if (listR.Type.Equals("countuserclienttype"))
            {
                if (listR.Symbol.Equals("E"))
                {
                    label_for_ExchangeUser.Text = listR.Num + "";
                }
                if (listR.Symbol.Equals("C"))
                {
                    label_for_CommonUser.Text = listR.Num + "";
                }
                if (listR.Symbol.Equals("M"))
                {
                    label_for_MemberUser.Text = listR.Num + "";
                }
            }


            if (listR.Type.Equals("countuserendtype"))
            {
                if (listR.Symbol.Equals("Mobile"))
                {
                    label_for_EndMobile.Text = listR.Num + "";
                }
                if (listR.Symbol.Equals("PC"))
                {
                    label_for_EndPC.Text = listR.Num + "";
                }
            }
            if (listR.Type.Equals("countusersvraddr"))
            {
                if (listR.Symbol.Equals("222.222.222.222"))
                {
                    label_for_svraddr_2.Text = listR.Num + "";
                }
                if (listR.Symbol.Equals("111.111.111.111"))
                {
                    label_for_svraddr_1.Text = listR.Num + "";
                }
            }
        }