EventHandlerList Class

 
System_CAPS_noteNote

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.

Namespace:   System.ComponentModel
Assembly:  System (in System.dll)

System::Object
  System.ComponentModel::EventHandlerList

[HostProtectionAttribute(SecurityAction::LinkDemand, SharedState = true)]
public ref class EventHandlerList sealed : IDisposable

NameDescription
System_CAPS_pubmethodEventHandlerList()

Initializes a new instance of the EventHandlerList class.

NameDescription
System_CAPS_pubpropertyItem[Object^]

Gets or sets the delegate for the specified object.

NameDescription
System_CAPS_pubmethodAddHandler(Object^, Delegate^)

Adds a delegate to the list.

System_CAPS_pubmethodAddHandlers(EventHandlerList^)

Adds a list of delegates to the current list.

System_CAPS_pubmethodDispose()

Disposes the delegate list.

System_CAPS_pubmethodEquals(Object^)

Determines whether the specified object is equal to the current object.(Inherited from Object.)

System_CAPS_pubmethodGetHashCode()

Serves as the default hash function. (Inherited from Object.)

System_CAPS_pubmethodGetType()

Gets the Type of the current instance.(Inherited from Object.)

System_CAPS_pubmethodRemoveHandler(Object^, Delegate^)

Removes a delegate from the list.

System_CAPS_pubmethodToString()

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.

.NET Framework
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.

Return to top
Show: