EventEmitter/EventEmitter.cs
/// <summary>
/// Removes all methods from the event [eventName]
/// </summary>
/// <param name="eventNames">Event name to remove methods from</param>
Removes all methods from the event [eventName]
Removes all methods from the event [ eventName ]
public void RemoveAllListeners(string eventNames)
        {
            _rwl.EnterWriteLock();
            var eventNameList = eventNames.Split(EventSeparator, StringSplitOptions.RemoveEmptyEntries);
            foreach (var eventName in eventNameList)
            {
                if (!_events.TryGetValue(eventName, out var subscribedMethods))
                {
                    throw new DoesNotExistException(string.Format("Event [{0}] does not exist to have methods removed.", eventName));
                }
                else
                {
                    subscribedMethods.RemoveAll(m => true);
                }
            }
            _rwl.ExitWriteLock();
        }
public void RemoveAllListeners ( string eventNames ) { _rwl . EnterWriteLock ( ) ; var eventNameList = eventNames . Split ( EventSeparator , StringSplitOptions . RemoveEmptyEntries ) ; foreach ( var eventName in eventNameList ) { if ( ! _events . TryGetValue ( eventName , out var subscribedMethods ) ) { throw new DoesNotExistException ( string . Format ( " " , eventName ) ) ; } else { subscribedMethods . RemoveAll ( m => true ) ; } } _rwl . ExitWriteLock ( ) ; }
Removes all methods from the event [eventName]
Removes all methods from the event [ eventName ]
eventNames
string
Event name to remove methods from
Event name to remove methods from