Пример #1
0
        public void RemoveEventHandler(Delegate?handler, [CallerMemberName] string eventName = "")
        {
            if (IsNullOrWhiteSpace(eventName))
            {
                throw new ArgumentNullException(nameof(eventName));
            }

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

            var methodInfo = handler.GetMethodInfo() ?? throw new NullReferenceException("Could not locate MethodInfo");

            EventManagerService.RemoveEventHandler(eventName, handler.Target, methodInfo, eventHandlers);
        }
Пример #2
0
 public void RaiseEvent(string eventName) => EventManagerService.HandleEvent(eventName, eventHandlers);
Пример #3
0
 public void RaiseEvent(object?sender, object eventArgs, string eventName) =>
 EventManagerService.HandleEvent(eventName, sender, eventArgs, eventHandlers);