Name

EventHandlerList

Synopsis

This class encapsulates a set of event handlers. You can use AddHandler() and RemoveHandler( ) to manipulate the list of delegates bound to particular objects, and you can retrieve the delegate bound to a particular object by using the Item property (this is the indexer for the class).

Note that this class does not implement any of the standard collection interfaces.


public sealed class EventHandlerList : IDisposable {

// Public Constructors

   public EventHandlerList();

// Public Instance Properties

   public Delegate this{set; get; }

// Public Instance Methods

   public void AddHandler(object key, Delegate value);

   public void Dispose();  // implements IDisposable

   public void RemoveHandler(object key, Delegate value);

}

Returned By

Component.Events, MarshalByValueComponent.Events

Get .NET Windows Forms in a Nutshell now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.