Exemplo n.º 1
0
        /// <summary>
        ///     Adds this handler for the
        ///     specified target to the route
        /// </summary>
        /// <remarks>
        ///     NOTE: It is not an error to add a
        ///     handler for a particular target instance
        ///     twice (handler will simply be called twice).
        /// </remarks>
        /// <param name="target">
        ///     Target object whose handler is to be
        ///     added to the route
        /// </param>
        /// <param name="handler">
        ///     Handler to be added to the route
        /// </param>
        /// <param name="handledEventsToo">
        ///     Flag indicating whether or not the listener wants to
        ///     hear about events that have already been handled
        /// </param>
        public void Add(object target, Delegate handler, bool handledEventsToo)
        {
            if (target == null)
            {
                throw new ArgumentNullException("target");
            }

            if (handler == null)
            {
                throw new ArgumentNullException("handler");
            }

            RouteItem routeItem = new RouteItem(target, new RoutedEventHandlerInfo(handler, handledEventsToo));

            _routeItemList.Add(routeItem);
        }
Exemplo n.º 2
0
        /// <summary>
        ///     Adds this handler for the 
        ///     specified target to the route
        /// </summary>
        /// <remarks>
        ///     NOTE: It is not an error to add a 
        ///     handler for a particular target instance 
        ///     twice (handler will simply be called twice). 
        /// </remarks>
        /// <param name="target">
        ///     Target object whose handler is to be 
        ///     added to the route
        /// </param>
        /// <param name="handler">
        ///     Handler to be added to the route
        /// </param>
        /// <param name="handledEventsToo">
        ///     Flag indicating whether or not the listener wants to 
        ///     hear about events that have already been handled
        /// </param>
        public void Add(object target, Delegate handler, bool handledEventsToo)
        {
            if (target == null)
            {
                throw new ArgumentNullException("target"); 
            }

            if (handler == null)
            {
                throw new ArgumentNullException("handler"); 
            }
            
            RouteItem routeItem = new RouteItem(target, new RoutedEventHandlerInfo(handler, handledEventsToo));

            _routeItemList.Add(routeItem);
        }
Exemplo n.º 3
0
 /// <summary> 
 ///     Is the given RouteItem equals the current 
 /// </summary>
 public bool Equals(RouteItem routeItem) 
 {
     return (
         routeItem._target == this._target &&
         routeItem._routedEventHandlerInfo == this._routedEventHandlerInfo); 
 }
Exemplo n.º 4
0
 /// <summary>
 ///     Is the given RouteItem equals the current
 /// </summary>
 public bool Equals(RouteItem routeItem)
 {
     return(
         routeItem._target == this._target &&
         routeItem._routedEventHandlerInfo == this._routedEventHandlerInfo);
 }