public void CancelSubscriMessage(string clientId, ClonableConsumeEventHandler eventConsume) { if (eventConsume != null) { if (this.messagesNotifyEvent != null) { if (this.messagesNotifyEvent[clientId].GetInvocationList().Contains(eventConsume)) { this.messagesNotifyEvent[clientId] -= eventConsume; } } } }
public void SubscrMessage(string clientId, ClonableConsumeEventHandler eventConsume) { if (eventConsume != null) { if (this.messagesNotifyEvent != null) { if (!this.messagesNotifyEvent[clientId].GetInvocationList().Contains(eventConsume)) { this.messagesNotifyEvent[clientId] += eventConsume; } } else { this.messagesNotifyEvent.Add(clientId, eventConsume); } } }