EventBuilder 类

定义

定义类的事件。Defines events for a class.

public ref class EventBuilder sealed
public ref class EventBuilder sealed : System::Runtime::InteropServices::_EventBuilder
public ref class EventBuilder
public sealed class EventBuilder
[System.Runtime.InteropServices.ClassInterface(System.Runtime.InteropServices.ClassInterfaceType.None)]
public sealed class EventBuilder : 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
public class EventBuilder
type EventBuilder = class
[<System.Runtime.InteropServices.ClassInterface(System.Runtime.InteropServices.ClassInterfaceType.None)>]
type EventBuilder = class
    interface _EventBuilder
[<System.Runtime.InteropServices.ClassInterface(System.Runtime.InteropServices.ClassInterfaceType.None)>]
[<System.Runtime.InteropServices.ComVisible(true)>]
type EventBuilder = class
    interface _EventBuilder
Public NotInheritable Class EventBuilder
Public NotInheritable Class EventBuilder
Implements _EventBuilder
Public Class EventBuilder
继承
EventBuilder
属性
实现

注解

EventBuilder始终与关联 TypeBuilderAn 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()

返回该事件的标记。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)

将一组名称映射为对应的一组调度标识符。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.

适用于