EventBuilder 類別

定義

定義類別的事件。Defines events for a class.

public ref class EventBuilder sealed : System::Runtime::InteropServices::_EventBuilder
[System.Runtime.InteropServices.ClassInterface(System.Runtime.InteropServices.ClassInterfaceType.None)]
[System.Runtime.InteropServices.ComVisible(true)]
public sealed class EventBuilder : System.Runtime.InteropServices._EventBuilder
type EventBuilder = class
    interface _EventBuilder
Public NotInheritable Class EventBuilder
Implements _EventBuilder
繼承
EventBuilder
屬性
實作

備註

EventBuilder 一律與 TypeBuilder相關聯。An EventBuilder is always associated with a TypeBuilder. TypeBuilder. DefineEvent 方法會將新的 EventBuilder 傳回給用戶端。The TypeBuilder.DefineEvent method will return a new EventBuilder to a client.

建構函式

EventBuilder()

方法

AddOtherMethod(MethodBuilder)

加入一個與這個事件相關聯的「其他」方法。Adds one of the "other" methods associated with this event. 「其他」方法是指除了「on」和「raise」方法之外,與這個事件關聯的方法。"Other" methods are methods other than the "on" and "raise" methods associated with an event. 您可呼叫這個函式許多次,視需要加入許多「其他」方法。This function can be called many times to add as many "other" methods.

Equals(Object)

判斷指定的物件是否等於目前的物件。Determines whether the specified object is equal to the current object.

(繼承來源 Object)
GetEventToken()

傳回這個事件的語彙基元 (Token)。Returns the token for this event.

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)
SetAddOnMethod(MethodBuilder)

設定用來訂閱這個事件的方法。Sets the method used to subscribe to this event.

SetCustomAttribute(ConstructorInfo, Byte[])

使用指定的自訂屬性 Blob 來設定自訂屬性。Set a custom attribute using a specified custom attribute blob.

SetCustomAttribute(CustomAttributeBuilder)

使用自訂屬性產生器來設定自訂屬性。Sets a custom attribute using a custom attribute builder.

SetRaiseMethod(MethodBuilder)

設定用來引發這個事件的方法。Sets the method used to raise this event.

SetRemoveOnMethod(MethodBuilder)

設定用來取消訂閱這個事件的方法。Sets the method used to unsubscribe to this event.

ToString()

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

(繼承來源 Object)

明確介面實作

_EventBuilder.GetIDsOfNames(Guid, IntPtr, UInt32, UInt32, IntPtr)

將一組名稱對應至一組對應的分派識別項 (Dispatch Identifier)。Maps a set of names to a corresponding set of dispatch identifiers.

_EventBuilder.GetTypeInfo(UInt32, UInt32, IntPtr)

擷取物件的類型資訊,可以用來取得介面的類型資訊。Retrieves the type information for an object, which can then be used to get the type information for an interface.

_EventBuilder.GetTypeInfoCount(UInt32)

擷取物件提供的類型資訊介面數目 (0 或 1)。Retrieves the number of type information interfaces that an object provides (either 0 or 1).

_EventBuilder.Invoke(UInt32, Guid, UInt32, Int16, IntPtr, IntPtr, IntPtr, IntPtr)

提供物件所公開的屬性和方法的存取權。Provides access to properties and methods exposed by an object.

適用於