Esempio n. 1
0
        protected void RemoveUpdateHandler(ComponentEventAction handler)
        {
            HashSet <ComponentEventAction> handlers;

            if (SharedUpdateRegistry.TryGetValue(handler.Frequency, out handlers))
            {
                handlers.Remove(handler);
            }
        }
Esempio n. 2
0
        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);
        }
Esempio n. 3
0
        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);
        }