EventHandlerList 類別

定義

提供委派 (Delegate) 的簡單清單。Provides a simple list of delegates. 此類別無法獲得繼承。This class cannot be inherited.

public ref class EventHandlerList sealed : IDisposable
public sealed class EventHandlerList : IDisposable
type EventHandlerList = class
    interface IDisposable
Public NotInheritable Class EventHandlerList
Implements IDisposable
繼承
EventHandlerList
實作

範例

如需使用 EventHandlerList的範例,請參閱如何:使用事件屬性處理多個事件For an example of using an EventHandlerList, see How to: Handle Multiple Events Using Event Properties.

備註

這個類別會使用線性搜尋演算法來尋找委派清單中的專案。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.

建構函式

EventHandlerList()

初始化 EventHandlerList 類別的新執行個體。Initializes a new instance of the EventHandlerList class.

屬性

Item[Object]

取得或設定指定物件的委派。Gets or sets the delegate for the specified object.

方法

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.

(繼承來源 Object)
GetHashCode()

作為預設雜湊函數。Serves as the default hash function.

(繼承來源 Object)
GetType()

取得目前執行個體的 TypeGets the Type of the current instance.

(繼承來源 Object)
MemberwiseClone()

建立目前 Object 的淺層複製。Creates a shallow copy of the current Object.

(繼承來源 Object)
RemoveHandler(Object, Delegate)

將委派從清單移除。Removes a delegate from the list.

ToString()

傳回代表目前物件的字串。Returns a string that represents the current object.

(繼承來源 Object)

適用於