public QMessage(QMessage _message) { Name = _message.Name; Sender = _message.Sender; Content = _message.Content; foreach (KeyValuePair <string, object> kvp in _message.dicDatas) { this [kvp.Key] = kvp.Value; } }
private void DispatchEvent(QMessage _message) { if (null == dicMessageEvents || !dicMessageEvents.ContainsKey(_message.Name)) { return; } List <MessageEvnet> list = dicMessageEvents [_message.Name]; for (int i = 0; i < list.Count; i++) { MessageEvnet messageEvent = list [i]; if (null != messageEvent) { messageEvent(_message); } } }
public void SendMessage(QMessage _message) { DispatchEvent(_message); }