public override bool Equals(object obj)
        {
            RoutedEventHandlerInfo handlerInfo = obj as RoutedEventHandlerInfo;

            if (handlerInfo == null)
            {
                return(false);
            }
            return(this.Equals(handlerInfo));
        }
Пример #2
0
        private static void AddRoutedEventHandler(Hashtable table, RoutedEvent routedEvent, RoutedEventHandler handler, bool handledEventsToo)
        {
            if (routedEvent == null || handler == null)
            {
                throw new ArgumentNullException();
            }
            RoutedEventHandlerInfo eventHandlerInfo = new RoutedEventHandlerInfo(handler, handledEventsToo);
            ArrayList arrayList = (ArrayList)table[(object)routedEvent];

            if (arrayList == null)
            {
                table[(object)routedEvent] = (object)(arrayList = new ArrayList());
            }
            arrayList.Add((object)eventHandlerInfo);
        }
Пример #3
0
        internal void InvokeHandler(RouteItem routeItem)
        {
            RoutedEventHandlerInfo info = routeItem._routedEventHandlerInfo;

            if (!this.Handled || info._handledEventsToo)
            {
                RoutedEventHandler handler = info._handler;
                this._flags |= Flags.InvokingHandler;
                try
                {
                    handler(routeItem._target, this);
                }
                finally
                {
                    this._flags &= ~Flags.InvokingHandler;
                }
            }
        }
Пример #4
0
        private void AddToEventRouteImpl(EventRoute route, RoutedEventArgs args)
        {
            Hashtable   eventHandlersStore = UIElement._classEventHandlersStore;
            RoutedEvent routedEvent        = args._routedEvent;

            for (int index1 = 0; index1 < 2; ++index1)
            {
                if (eventHandlersStore != null)
                {
                    ArrayList arrayList = (ArrayList)eventHandlersStore[(object)routedEvent];
                    if (arrayList != null)
                    {
                        int index2 = 0;
                        for (int count = arrayList.Count; index2 < count; ++index2)
                        {
                            RoutedEventHandlerInfo eventHandlerInfo = (RoutedEventHandlerInfo)arrayList[index2];
                            route.Add((object)this, eventHandlerInfo._handler, eventHandlerInfo._handledEventsToo);
                        }
                    }
                }
                eventHandlersStore = this._instanceEventHandlersStore;
            }
        }
 public bool Equals(RoutedEventHandlerInfo handlerInfo)
 {
     return((this._handler == handlerInfo._handler) && (this._handledEventsToo == handlerInfo._handledEventsToo));
 }
Пример #6
0
 internal RouteItem(object target, RoutedEventHandlerInfo routedEventHandlerInfo)
 {
     this._target = target;
     this._routedEventHandlerInfo = routedEventHandlerInfo;
 }