public void UnregisterMessageHandler <T>(MessageTypeKey token, Action <object> handler) where T : Message { if (this.handlers.ContainsKey(token.Key)) { this.handlers[token.Key].Remove(handler); } }
public void RegisterMessageHandler <T>(MessageTypeKey token, Action <object> handler) where T : Message { if (!this.handlers.ContainsKey(token.Key)) { this.handlers[token.Key] = new List <Action <object> >(); } this.handlers[token.Key].Add(handler); }
public Message CreateMessage(MessageTypeKey token) { return(this.CreateMessage(token.Key)); }
public void UnregisterMessageFactory(MessageTypeKey token) { this.factories.Remove(token.Key); }