Type.IsImport 属性

定义

获取一个值,该值指示 Type 是否应用了 ComImportAttribute 属性,如果应用了该属性,则表示它是从 COM 类型库导入的。Gets a value indicating whether the Type has a ComImportAttribute attribute applied, indicating that it was imported from a COM type library.

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

属性值

如果 true 具有 Type,则为 ComImportAttribute;否则为 falsetrue if the Type has a ComImportAttribute; otherwise, false.

实现

注解

如果当前 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.

适用于

另请参阅