public EventRouteItem(RoutedEventHandlerItem handler, object originalSource, object source, object target) { this.handler = handler; this.originalSource = originalSource; this.source = source; this.target = target; }
private static void RegisterClassHandler(Type classType, RoutedEvent routedEvent, RoutedEventHandlerItem eventRouteItem) { ClassHandlerKey key = new ClassHandlerKey(classType, routedEvent); if (flattenedClassHandlersCache.Contains(key)) { throw new Granular.Exception("{0} class handler for \"{1}\" has already been queried, RegisterClassHandler should only be called from {0}'s static constructor", classType.Name, routedEvent); } classHandlers.Add(key, eventRouteItem); }
private static IEnumerable<RoutedEventHandlerItem> ResolveFlattenedClassHandlers(ClassHandlerKey key) { IEnumerable<RoutedEventHandlerItem> handlers = new RoutedEventHandlerItem[0]; Type type = key.ClassType; while (type != null) { handlers = classHandlers.GetValues(new ClassHandlerKey(type, key.RoutedEvent)).Concat(handlers); type = type.BaseType; } return handlers.ToArray(); }