ComAwareEventInfo ComAwareEventInfo ComAwareEventInfo ComAwareEventInfo Class

定义

警告

此 API 现已过时。

允许事件处理程序的后期绑定注册。Permits late-bound registration of an event handler.

public ref class ComAwareEventInfo : System::Reflection::EventInfo
[System.Obsolete("ComAwareEventInfo may be unavailable in future releases.")]
public class ComAwareEventInfo : System.Reflection.EventInfo
type ComAwareEventInfo = class
    inherit EventInfo
Public Class ComAwareEventInfo
Inherits EventInfo
继承
ComAwareEventInfoComAwareEventInfoComAwareEventInfoComAwareEventInfo
属性

注解

通常情况下,编译器会自动嵌入到调用ComAwareEventInfo.AddEventHandler(Object, Delegate)ComAwareEventInfo.RemoveEventHandler(Object, Delegate)而不是使用正则方法将处理程序添加和删除的事件处理程序方法。Normally, compilers will automatically embed calls to the ComAwareEventInfo.AddEventHandler(Object, Delegate) and ComAwareEventInfo.RemoveEventHandler(Object, Delegate) methods instead of using regular add handler and remove handler methods for events. 如果发生这种情况,需要嵌入上定义相应的事件的接口。This occurs if the interface that the corresponding event is defined on needs to be embedded.

可以通过将嵌入整个程序集使用包含此接口来指定此 /link编译器上或通过设置选项嵌入互操作类型属性设置为True视觉对象中Studio。You can specify this by embedding the entire assembly that contains the interface by using the /link option on the compilers or by setting the Embed Interop Types property to True in Visual Studio.

ComAwareEventInfo类型派生EventInfo类,并重写EventInfo.AddEventHandler(Object, Delegate)EventInfo.RemoveEventHandler(Object, Delegate)方法。The ComAwareEventInfo type derives from the EventInfo class and overrides the EventInfo.AddEventHandler(Object, Delegate) and EventInfo.RemoveEventHandler(Object, Delegate) methods.

构造函数

ComAwareEventInfo(Type, String) ComAwareEventInfo(Type, String) ComAwareEventInfo(Type, String) ComAwareEventInfo(Type, String)

使用指定类型和该类型的事件名称来初始化 ComAwareEventInfo 类的新实例。Initializes a new instance of the ComAwareEventInfo class by using the specified type and a name of the event on the type.

属性

AddMethod AddMethod AddMethod AddMethod

获取事件的 AddEventHandler(Object, Delegate) 方法的 MethodInfo 对象,包括非公共方法。Gets the MethodInfo object for the AddEventHandler(Object, Delegate) method of the event, including non-public methods.

(Inherited from EventInfo)
Attributes Attributes Attributes Attributes

获取此事件的属性。Gets the attributes for this event.

CustomAttributes CustomAttributes CustomAttributes CustomAttributes

获取包含此成员自定义属性的集合。Gets a collection that contains this member's custom attributes.

(Inherited from MemberInfo)
DeclaringType DeclaringType DeclaringType DeclaringType

获取声明该成员的类。Gets the class that declares this member.

EventHandlerType EventHandlerType EventHandlerType EventHandlerType

获取与此事件关联的基础事件处理程序委托的 Type 对象。Gets the Type object of the underlying event-handler delegate associated with this event.

(Inherited from EventInfo)
IsCollectible IsCollectible IsCollectible IsCollectible

获取一个值,该值指示此 MemberInfo 对象是否是包含在可回收的 AssemblyLoadContext 中的程序集的一部分。Gets a value that indicates whether this MemberInfo object is part of an assembly held in a collectible AssemblyLoadContext.

(Inherited from MemberInfo)
IsMulticast IsMulticast IsMulticast IsMulticast

获取一个值,该值指示事件是否为多播。Gets a value indicating whether the event is multicast.

(Inherited from EventInfo)
IsSpecialName IsSpecialName IsSpecialName IsSpecialName

获取一个值,该值指示 EventInfo 是否具有一个有特殊意义的名称。Gets a value indicating whether the EventInfo has a name with a special meaning.

(Inherited from EventInfo)
MemberType MemberType MemberType MemberType

获取 MemberTypes 值,指示此成员为一个事件。Gets a MemberTypes value indicating that this member is an event.

(Inherited from EventInfo)
MetadataToken MetadataToken MetadataToken MetadataToken

获取一个值,该值标识元数据元素。Gets a value that identifies a metadata element.

(Inherited from MemberInfo)
Module Module Module Module

获取一个模块,在该模块中已经定义一个类型,该类型用于声明由当前 MemberInfo 表示的成员。Gets the module in which the type that declares the member represented by the current MemberInfo is defined.

(Inherited from MemberInfo)
Name Name Name Name

获取当前成员的名称。Gets the name of the current member.

RaiseMethod RaiseMethod RaiseMethod RaiseMethod

获取引发该事件时所调用的方法,包括非公共方法。Gets the method that is called when the event is raised, including non-public methods.

(Inherited from EventInfo)
ReflectedType ReflectedType ReflectedType ReflectedType

获取用于初始化此实例的类对象。Gets the class object that was used to initialize this instance.

RemoveMethod RemoveMethod RemoveMethod RemoveMethod

获取用于删除事件方法的 MethodInfo 对象,包括非公共方法。Gets the MethodInfo object for removing a method of the event, including non-public methods.

(Inherited from EventInfo)

方法

AddEventHandler(Object, Delegate) AddEventHandler(Object, Delegate) AddEventHandler(Object, Delegate) AddEventHandler(Object, Delegate)

将事件处理程序附加到 COM 对象。Attaches an event handler to a COM object.

Equals(Object) Equals(Object) Equals(Object) Equals(Object)

返回一个值,该值指示此实例是否与指定的对象相等。Returns a value that indicates whether this instance is equal to a specified object.

(Inherited from EventInfo)
GetAddMethod() GetAddMethod() GetAddMethod() GetAddMethod()

返回用于向事件源添加事件处理程序委托的方法。Returns the method used to add an event handler delegate to the event source.

(Inherited from EventInfo)
GetAddMethod(Boolean) GetAddMethod(Boolean) GetAddMethod(Boolean) GetAddMethod(Boolean)

获取用于将事件处理程序委托添加到事件源的方法。Gets the method that was used to add an event handler delegate to the event source.

GetCustomAttributes(Boolean) GetCustomAttributes(Boolean) GetCustomAttributes(Boolean) GetCustomAttributes(Boolean)

在派生类中重写时,获取一个包含应用于此成员的所有自定义特性的数组。When overridden in a derived class, gets an array that contains all the custom attributes that are applied to this member.

GetCustomAttributes(Type, Boolean) GetCustomAttributes(Type, Boolean) GetCustomAttributes(Type, Boolean) GetCustomAttributes(Type, Boolean)

在派生类中重写时,获取一个数组,该数组包含应用于此成员的指定类型的所有自定义特性。When overridden in a derived class, gets an array that contains all the custom attributes of the specified type that are applied to this member.

GetCustomAttributesData() GetCustomAttributesData() GetCustomAttributesData() GetCustomAttributesData()

返回 CustomAttributeData 对象列表,这些对象表示已应用到目标成员的特性相关数据。Returns a list of CustomAttributeData objects representing data about the attributes that have been applied to the target member.

(Inherited from MemberInfo)
GetHashCode() GetHashCode() GetHashCode() GetHashCode()

返回此实例的哈希代码。Returns the hash code for this instance.

(Inherited from EventInfo)
GetOtherMethods() GetOtherMethods() GetOtherMethods() GetOtherMethods()

返回在元数据中使用 .other 指令与事件相关联的公共方法。Returns the public methods that have been associated with an event in metadata using the .other directive.

(Inherited from EventInfo)
GetOtherMethods(Boolean) GetOtherMethods(Boolean) GetOtherMethods(Boolean) GetOtherMethods(Boolean)

返回在元数据中使用 .other 指令与事件相关联的方法,指定是否包括非公共方法。Returns the methods that have been associated with the event in metadata using the .other directive, specifying whether to include non-public methods.

(Inherited from EventInfo)
GetRaiseMethod() GetRaiseMethod() GetRaiseMethod() GetRaiseMethod()

返回引发事件时所调用的方法。Returns the method that is called when the event is raised.

(Inherited from EventInfo)
GetRaiseMethod(Boolean) GetRaiseMethod(Boolean) GetRaiseMethod(Boolean) GetRaiseMethod(Boolean)

在派生类中重写时,返回引发该事件时调用的方法。When overridden in a derived class, returns the method that was called when the event was raised.

GetRemoveMethod() GetRemoveMethod() GetRemoveMethod() GetRemoveMethod()

返回用于从事件源删除事件处理程序委托的方法。Returns the method used to remove an event handler delegate from the event source.

(Inherited from EventInfo)
GetRemoveMethod(Boolean) GetRemoveMethod(Boolean) GetRemoveMethod(Boolean) GetRemoveMethod(Boolean)

在派生类中重写时,检索用于移除该事件的方法的 MethodInfo 对象。When overridden in a derived class, retrieves the MethodInfo object for removing a method of the event.

GetType() GetType() GetType() GetType() Inherited from EventInfo
HasSameMetadataDefinitionAs(MemberInfo) HasSameMetadataDefinitionAs(MemberInfo) HasSameMetadataDefinitionAs(MemberInfo) HasSameMetadataDefinitionAs(MemberInfo) Inherited from MemberInfo
IsDefined(Type, Boolean) IsDefined(Type, Boolean) IsDefined(Type, Boolean) IsDefined(Type, Boolean)

指示是否对此成员应用指定特性的一个或多个实例。Indicates whether one or more instances of the specified attribute are applied to this member.

MemberwiseClone() MemberwiseClone() MemberwiseClone() MemberwiseClone()

创建当前 Object 的浅表副本。Creates a shallow copy of the current Object.

(Inherited from Object)
RemoveEventHandler(Object, Delegate) RemoveEventHandler(Object, Delegate) RemoveEventHandler(Object, Delegate) RemoveEventHandler(Object, Delegate)

将事件处理程序从 COM 对象分离。Detaches an event handler from a COM object.

ToString() ToString() ToString() ToString()

返回表示当前对象的字符串。Returns a string that represents the current object.

(Inherited from Object)

显式界面实现

ICustomAttributeProvider.GetCustomAttributes(Boolean) ICustomAttributeProvider.GetCustomAttributes(Boolean) ICustomAttributeProvider.GetCustomAttributes(Boolean) ICustomAttributeProvider.GetCustomAttributes(Boolean) Inherited from MemberInfo
ICustomAttributeProvider.GetCustomAttributes(Type, Boolean) ICustomAttributeProvider.GetCustomAttributes(Type, Boolean) ICustomAttributeProvider.GetCustomAttributes(Type, Boolean) ICustomAttributeProvider.GetCustomAttributes(Type, Boolean) Inherited from MemberInfo
ICustomAttributeProvider.IsDefined(Type, Boolean) ICustomAttributeProvider.IsDefined(Type, Boolean) ICustomAttributeProvider.IsDefined(Type, Boolean) ICustomAttributeProvider.IsDefined(Type, Boolean) Inherited from MemberInfo
_EventInfo.GetIDsOfNames(Guid, IntPtr, UInt32, UInt32, IntPtr) _EventInfo.GetIDsOfNames(Guid, IntPtr, UInt32, UInt32, IntPtr) _EventInfo.GetIDsOfNames(Guid, IntPtr, UInt32, UInt32, IntPtr) _EventInfo.GetIDsOfNames(Guid, IntPtr, UInt32, UInt32, IntPtr)

将一组名称映射为对应的一组调度标识符。Maps a set of names to a corresponding set of dispatch identifiers.

(Inherited from EventInfo)
_EventInfo.GetType() _EventInfo.GetType() _EventInfo.GetType() _EventInfo.GetType()

返回表示 EventInfo 类型的 T:System.Type 对象。Returns a T:System.Type object representing the EventInfo type.

(Inherited from EventInfo)
_EventInfo.GetTypeInfo(UInt32, UInt32, IntPtr) _EventInfo.GetTypeInfo(UInt32, UInt32, IntPtr) _EventInfo.GetTypeInfo(UInt32, UInt32, IntPtr) _EventInfo.GetTypeInfo(UInt32, UInt32, IntPtr)

检索对象的类型信息,然后可以使用该信息获取接口的类型信息。Retrieves the type information for an object, which can then be used to get the type information for an interface.

(Inherited from EventInfo)
_EventInfo.GetTypeInfoCount(UInt32) _EventInfo.GetTypeInfoCount(UInt32) _EventInfo.GetTypeInfoCount(UInt32) _EventInfo.GetTypeInfoCount(UInt32)

检索对象提供的类型信息接口的数量(0 或 1)。Retrieves the number of type information interfaces that an object provides (either 0 or 1).

(Inherited from EventInfo)
_EventInfo.Invoke(UInt32, Guid, UInt32, Int16, IntPtr, IntPtr, IntPtr, IntPtr) _EventInfo.Invoke(UInt32, Guid, UInt32, Int16, IntPtr, IntPtr, IntPtr, IntPtr) _EventInfo.Invoke(UInt32, Guid, UInt32, Int16, IntPtr, IntPtr, IntPtr, IntPtr) _EventInfo.Invoke(UInt32, Guid, UInt32, Int16, IntPtr, IntPtr, IntPtr, IntPtr)

提供对某一对象公开的属性和方法的访问。Provides access to properties and methods exposed by an object.

(Inherited from EventInfo)
_MemberInfo.GetIDsOfNames(Guid, IntPtr, UInt32, UInt32, IntPtr) _MemberInfo.GetIDsOfNames(Guid, IntPtr, UInt32, UInt32, IntPtr) _MemberInfo.GetIDsOfNames(Guid, IntPtr, UInt32, UInt32, IntPtr) _MemberInfo.GetIDsOfNames(Guid, IntPtr, UInt32, UInt32, IntPtr)

将一组名称映射为对应的一组调度标识符。Maps a set of names to a corresponding set of dispatch identifiers.

(Inherited from MemberInfo)
_MemberInfo.GetType() _MemberInfo.GetType() _MemberInfo.GetType() _MemberInfo.GetType()

获取一个表示 MemberInfo 类的 Type 对象。Gets a Type object representing the MemberInfo class.

(Inherited from MemberInfo)
_MemberInfo.GetTypeInfo(UInt32, UInt32, IntPtr) _MemberInfo.GetTypeInfo(UInt32, UInt32, IntPtr) _MemberInfo.GetTypeInfo(UInt32, UInt32, IntPtr) _MemberInfo.GetTypeInfo(UInt32, UInt32, IntPtr)

检索对象的类型信息,然后可以使用该信息获取接口的类型信息。Retrieves the type information for an object, which can then be used to get the type information for an interface.

(Inherited from MemberInfo)
_MemberInfo.GetTypeInfoCount(UInt32) _MemberInfo.GetTypeInfoCount(UInt32) _MemberInfo.GetTypeInfoCount(UInt32) _MemberInfo.GetTypeInfoCount(UInt32)

检索对象提供的类型信息接口的数量(0 或 1)。Retrieves the number of type information interfaces that an object provides (either 0 or 1).

(Inherited from MemberInfo)
_MemberInfo.Invoke(UInt32, Guid, UInt32, Int16, IntPtr, IntPtr, IntPtr, IntPtr) _MemberInfo.Invoke(UInt32, Guid, UInt32, Int16, IntPtr, IntPtr, IntPtr, IntPtr) _MemberInfo.Invoke(UInt32, Guid, UInt32, Int16, IntPtr, IntPtr, IntPtr, IntPtr) _MemberInfo.Invoke(UInt32, Guid, UInt32, Int16, IntPtr, IntPtr, IntPtr, IntPtr)

提供对某一对象公开的属性和方法的访问。Provides access to properties and methods exposed by an object.

(Inherited from MemberInfo)

Extension Methods

GetCustomAttribute(MemberInfo, Type) GetCustomAttribute(MemberInfo, Type) GetCustomAttribute(MemberInfo, Type) GetCustomAttribute(MemberInfo, Type)

检索应用于指定成员的指定类型的自定义特性。Retrieves a custom attribute of a specified type that is applied to a specified member.

GetCustomAttribute(MemberInfo, Type, Boolean) GetCustomAttribute(MemberInfo, Type, Boolean) GetCustomAttribute(MemberInfo, Type, Boolean) GetCustomAttribute(MemberInfo, Type, Boolean)

检索应用于指定成员的指定类型的自定义特性,并可选择检查该成员的上级。Retrieves a custom attribute of a specified type that is applied to a specified member, and optionally inspects the ancestors of that member.

GetCustomAttribute<T>(MemberInfo) GetCustomAttribute<T>(MemberInfo) GetCustomAttribute<T>(MemberInfo) GetCustomAttribute<T>(MemberInfo)

检索应用于指定成员的指定类型的自定义特性。Retrieves a custom attribute of a specified type that is applied to a specified member.

GetCustomAttribute<T>(MemberInfo, Boolean) GetCustomAttribute<T>(MemberInfo, Boolean) GetCustomAttribute<T>(MemberInfo, Boolean) GetCustomAttribute<T>(MemberInfo, Boolean)

检索应用于指定成员的指定类型的自定义特性,并可选择检查该成员的上级。Retrieves a custom attribute of a specified type that is applied to a specified member, and optionally inspects the ancestors of that member.

GetCustomAttributes(MemberInfo) GetCustomAttributes(MemberInfo) GetCustomAttributes(MemberInfo) GetCustomAttributes(MemberInfo)

检索应用于指定成员的自定义特性集合。Retrieves a collection of custom attributes that are applied to a specified member.

GetCustomAttributes(MemberInfo, Boolean) GetCustomAttributes(MemberInfo, Boolean) GetCustomAttributes(MemberInfo, Boolean) GetCustomAttributes(MemberInfo, Boolean)

检索应用于指定成员的自定义特性集合,并可选择检查该成员的上级。Retrieves a collection of custom attributes that are applied to a specified member, and optionally inspects the ancestors of that member.

GetCustomAttributes(MemberInfo, Type) GetCustomAttributes(MemberInfo, Type) GetCustomAttributes(MemberInfo, Type) GetCustomAttributes(MemberInfo, Type)

检索应用于指定成员的指定类型的自定义特性集合。Retrieves a collection of custom attributes of a specified type that are applied to a specified member.

GetCustomAttributes(MemberInfo, Type, Boolean) GetCustomAttributes(MemberInfo, Type, Boolean) GetCustomAttributes(MemberInfo, Type, Boolean) GetCustomAttributes(MemberInfo, Type, Boolean)

检索应用于指定成员的指定类型的自定义特性集合,并可选择检查该成员的上级。Retrieves a collection of custom attributes of a specified type that are applied to a specified member, and optionally inspects the ancestors of that member.

GetCustomAttributes<T>(MemberInfo) GetCustomAttributes<T>(MemberInfo) GetCustomAttributes<T>(MemberInfo) GetCustomAttributes<T>(MemberInfo)

检索应用于指定成员的指定类型的自定义特性集合。Retrieves a collection of custom attributes of a specified type that are applied to a specified member.

GetCustomAttributes<T>(MemberInfo, Boolean) GetCustomAttributes<T>(MemberInfo, Boolean) GetCustomAttributes<T>(MemberInfo, Boolean) GetCustomAttributes<T>(MemberInfo, Boolean)

检索应用于指定成员的指定类型的自定义特性集合,并可选择检查该成员的上级。Retrieves a collection of custom attributes of a specified type that are applied to a specified member, and optionally inspects the ancestors of that member.

IsDefined(MemberInfo, Type) IsDefined(MemberInfo, Type) IsDefined(MemberInfo, Type) IsDefined(MemberInfo, Type)

确定是否将指定类型的任何自定义属性应用于指定的成员。Indicates whether custom attributes of a specified type are applied to a specified member.

IsDefined(MemberInfo, Type, Boolean) IsDefined(MemberInfo, Type, Boolean) IsDefined(MemberInfo, Type, Boolean) IsDefined(MemberInfo, Type, Boolean)

指示一个指定类型的自定义特性是否应用于一个指定的数字,并选择性地应用于其的上级。Indicates whether custom attributes of a specified type are applied to a specified member, and, optionally, applied to its ancestors.

GetAddMethod(EventInfo) GetAddMethod(EventInfo) GetAddMethod(EventInfo) GetAddMethod(EventInfo)
GetAddMethod(EventInfo, Boolean) GetAddMethod(EventInfo, Boolean) GetAddMethod(EventInfo, Boolean) GetAddMethod(EventInfo, Boolean)
GetRaiseMethod(EventInfo) GetRaiseMethod(EventInfo) GetRaiseMethod(EventInfo) GetRaiseMethod(EventInfo)
GetRaiseMethod(EventInfo, Boolean) GetRaiseMethod(EventInfo, Boolean) GetRaiseMethod(EventInfo, Boolean) GetRaiseMethod(EventInfo, Boolean)
GetRemoveMethod(EventInfo) GetRemoveMethod(EventInfo) GetRemoveMethod(EventInfo) GetRemoveMethod(EventInfo)
GetRemoveMethod(EventInfo, Boolean) GetRemoveMethod(EventInfo, Boolean) GetRemoveMethod(EventInfo, Boolean) GetRemoveMethod(EventInfo, Boolean)
GetMetadataToken(MemberInfo) GetMetadataToken(MemberInfo) GetMetadataToken(MemberInfo) GetMetadataToken(MemberInfo)
HasMetadataToken(MemberInfo) HasMetadataToken(MemberInfo) HasMetadataToken(MemberInfo) HasMetadataToken(MemberInfo)

适用于