Type.IsCOMObject Type.IsCOMObject Type.IsCOMObject Type.IsCOMObject Property

定义

获取一个值,通过该值指示 Type 是否为 COM 对象。Gets a value indicating whether the Type is a COM object.

public:
 property bool IsCOMObject { bool get(); };
public bool IsCOMObject { get; }
member this.IsCOMObject : bool
Public ReadOnly Property IsCOMObject As Boolean

属性值

如果 true 为 COM 对象,则为 Type;否则为 falsetrue if the Type is a COM object; otherwise, false.

实现

注解

此方法对于false COM 接口返回,因为它们不是对象。This method returns false for COM interfaces because they are not objects. COM 接口可由 Microsoft .NET Framework 对象实现。COM interfaces can be implemented by Microsoft .NET Framework objects.

还可以通过使用Type tlbimp.exe (类型库导入程序)工具加载 com 类并获取该 com 类的对象。You can also load a COM class and get a Type object for that COM class by using the Tlbimp.exe (Type Library Importer) tool.

如果当前Type表示构造泛型类型,则此属性应用于构造该类型的泛型类型定义。If the current Type represents a constructed generic type, this property applies to the generic type definition from which the type was constructed. 例如,如果Type当前表示MyGenericType<int> (MyGenericType(Of Integer) Visual Basic),则此属性的值由确定MyGenericType<T>For example, if the current Type represents MyGenericType<int> (MyGenericType(Of Integer) in Visual Basic), the value of this property is determined by MyGenericType<T>.

如果当前Type表示泛型类型或泛型方法的定义中的类型参数,则此属性始终返回falseIf the current Type represents a type parameter in the definition of a generic type or generic method, this property always returns false.

适用于

另请参阅