protected void RemoveUpdateHandler(ComponentEventAction handler) { HashSet <ComponentEventAction> handlers; if (SharedUpdateRegistry.TryGetValue(handler.Frequency, out handlers)) { handlers.Remove(handler); } }
protected void AddUpdateHandler(ComponentEventAction handler) { HashSet <ComponentEventAction> handlers; if (!SharedUpdateRegistry.TryGetValue(handler.Frequency, out handlers)) { SharedUpdateRegistry[handler.Frequency] = handlers = new HashSet <ComponentEventAction>(); } handlers.Add(handler); }
private void AddToSessionEventRegistry(ComponentEventAction handler) { //Log.Trace($"{handler}"); SortedDictionary <int, List <ComponentEventAction> > eventHandlersByOrder; if (!SessionEventRegistry.TryGetValue(handler.EventName, out eventHandlersByOrder)) { SessionEventRegistry[handler.EventName] = eventHandlersByOrder = new SortedDictionary <int, List <ComponentEventAction> >(); } List <ComponentEventAction> eventHandlers; if (!eventHandlersByOrder.TryGetValue(handler.Order, out eventHandlers)) { eventHandlersByOrder[handler.Order] = eventHandlers = new List <ComponentEventAction>(); } eventHandlers.Add(handler); }