Exemplo n.º 1
0
        /// <summary>
        /// Removes the event handler
        /// </summary>
        /// <param name="handler">Handler</param>
        /// <param name="eventName">Event name</param>
        public void RemoveEventHandler(EventHandler <TEventArgs> handler, [CallerMemberName] string eventName = "")
        {
            if (IsNullOrWhiteSpace(eventName))
            {
                throw new ArgumentNullException(nameof(eventName));
            }

            if (handler is null)
            {
                throw new ArgumentNullException(nameof(handler));
            }

            EventManagerService.RemoveEventHandler(eventName, handler.Target, handler.GetMethodInfo(), _eventHandlers);
        }
Exemplo n.º 2
0
 /// <summary>
 /// Executes the event
 /// </summary>
 /// <param name="sender">Sender</param>
 /// <param name="eventArgs">Event arguments</param>
 /// <param name="eventName">Event name</param>
 public void HandleEvent(object sender, TEventArgs eventArgs, string eventName) =>
 EventManagerService.HandleEvent(eventName, sender, eventArgs, _eventHandlers);