/// <summary> /// 接收消息 /// </summary> /// <param name="messagType">消息分类</param> /// <param name="handler">消息委托</param> public void ReceiveMessage(string messagType, MessageCenter.DelMessageDelivery handler) { MessageCenter.AddMsgListener(messagType, handler); }
/// <summary> /// 发送消息 /// </summary> /// <param name="msgType">消息的类型</param> /// <param name="msgName">消息名称</param> /// <param name="msgContent">消息内容</param> protected void SendMessage(string msgType, string msgName, object msgContent) { KeyValuesUpdate kvs = new KeyValuesUpdate(msgName, msgContent); MessageCenter.SendMessage(msgType, kvs); }