/// <summary> /// 发送消息 /// </summary> /// <param name="messageType">消息的分类</param> /// <param name="kv">键值对(对象)</param> public static void SendMessage(string messageType, KeyValueUpdate kv) { delegateMessage del; //委托 if (dictionaryMessage.TryGetValue(messageType, out del)) { if (del != null) { //调用委托 del(kv); } } }
/// <summary> /// 发送消息 /// </summary> /// <param name="msgType">消息的类型</param> /// <param name="msgName">消息名称</param> /// <param name="msgContent">消息内容</param> protected void sendMessage(string msgType, string msgName, object msgContent) { KeyValueUpdate kvs = new KeyValueUpdate(msgName, msgContent); EventCenter.SendMessage(msgType, kvs); }