/// <summary> /// Unregisters all event names in a simple events class /// </summary> /// <param name="eventSystem"></param> /// <param name="eventList"></param> public static void UnregisterEvents(IEventSystem eventSystem, IEventList eventList) { if (eventSystem == null) { throw new ArgumentNullException(nameof(eventSystem)); } if (eventList == null) { throw new ArgumentNullException(nameof(eventList)); } foreach (var name in eventList.SimpleEvents) { eventSystem.UnregisterEvent(name); } foreach (var eventType in eventList.EventTypes) { eventSystem.UnregisterEvent(EventName(eventType)); } }