protected void NotifyObservers(OperationMessage message) { if (observerItems == null) { return; } foreach (var obItem in observerItems) { if (message.GetOperationType().Equals(obItem.OpType)) { NotifyObserver(message, obItem.Observer); } } }
public void SendMessage(OperationMessage message) { OnReceiveOperationMessage(message); }
// protected abstract List<OperationType> ParseOperationTypeOfObserver (IOperationObserver observer); protected abstract void NotifyObserver(OperationMessage message, IOperationObserver observer);
/// <summary> /// 解析分类message 子类重写 /// </summary> /// <param name="sender"></param> /// <param name="type"></param> /// <param name="message"></param> protected virtual void OnReceiveOperationMessage(OperationMessage operationMessage) { NotifyObservers(operationMessage); }