EventHandlerList Class
![]() |
---|
The .NET API Reference documentation has a new home. Visit the .NET API Browser on docs.microsoft.com to see the new experience. |
Provides a simple list of delegates. This class cannot be inherited.
Assembly: System (in System.dll)
Name | Description | |
---|---|---|
![]() | EventHandlerList() | Initializes a new instance of the EventHandlerList class. |
Name | Description | |
---|---|---|
![]() | Item[Object^] | Gets or sets the delegate for the specified object. |
Name | Description | |
---|---|---|
![]() | AddHandler(Object^, Delegate^) | Adds a delegate to the list. |
![]() | AddHandlers(EventHandlerList^) | Adds a list of delegates to the current list. |
![]() | Dispose() | Disposes the delegate list. |
![]() | Equals(Object^) | Determines whether the specified object is equal to the current object.(Inherited from Object.) |
![]() | GetHashCode() | Serves as the default hash function. (Inherited from Object.) |
![]() | GetType() | |
![]() | RemoveHandler(Object^, Delegate^) | Removes a delegate from the list. |
![]() | ToString() | Returns a string that represents the current object.(Inherited from Object.) |
This class uses a linear search algorithm to find entries in the list of delegates. A linear search algorithm is inefficient when working with a large number of entries. Therefore, when you have a large list, finding entries is slow.
For an example of using an EventHandlerList, see How to: Handle Multiple Events Using Event Properties.
Available since 1.1
Any public static ( Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.