Share via


Type 成员

表示类型声明:类类型、接口类型、数组类型、值类型、枚举类型、类型参数、泛型类型定义,以及开放或封闭构造的泛型类型。

下表列出了由 Type 类型公开的成员。

受保护的构造函数

  名称 说明
Protected method Supported by the .NET Compact Framework Type 初始化 Type 类的新实例。

页首

公共字段

  名称 说明
Public field Static Supported by the .NET Compact Framework Delimiter 分隔 Type 的命名空间中的名称。此字段为只读。
Public field Static EmptyTypes 表示 Type 类型的空数组。此字段为只读。
Public field Static FilterAttribute 表示用在属性 (Attribute) 上的成员筛选器。此字段为只读。
Public field Static FilterName 表示用于名称的区分大小写的成员筛选器。此字段为只读。
Public field Static FilterNameIgnoreCase 表示用于名称的不区分大小写的成员筛选器。此字段为只读。
Public field Static Supported by the .NET Compact Framework Missing 表示 Type 信息中的缺少值。此字段为只读。

页首

公共属性

  名称 说明
Public property Supported by the .NET Compact Framework Assembly 获取在其中声明该类型 Assembly。对于泛型类型,则获取在其中定义该泛型类型的 Assembly
Public property Supported by the .NET Compact Framework AssemblyQualifiedName 获取 Type 的程序集限定名,其中包括从中加载 Type 的程序集的名称。
Public property Supported by the .NET Compact Framework Attributes 获取与 Type 关联的属性。
Public property Supported by the .NET Compact Framework BaseType 获取当前 Type 直接从中继承的类型。
Public property Supported by the .NET Compact Framework ContainsGenericParameters 获取一个值,该值指示当前 Type 对象是否具有尚未被特定类型替代的类型参数。
Public property DeclaringMethod 获取一个表示声明方法的 MethodBase(如果当前 Type 表示泛型方法的一个类型参数)。
Public property Supported by the .NET Compact Framework DeclaringType 获取声明该成员的类。
Public property Static Supported by the .NET Compact Framework DefaultBinder 获取默认联编程序的引用,该程序实现的内部规则用于选择由 InvokeMember 调用的合适成员。
Public property Supported by the .NET Compact Framework FullName 获取 Type 的完全限定名,包括 Type 的命名空间,但不包括程序集。
Public property GenericParameterAttributes 获取描述当前泛型类型参数的协变和特殊约束的 GenericParameterAttributes 标志。
Public property GenericParameterPosition Type 对象表示泛型类型或泛型方法的类型参数时,获取类型参数在声明它的泛型类型或方法的类型参数列表中的位置。
Public property GUID 获取与 Type 关联的 GUID。
Public property Supported by the .NET Compact Framework HasElementType 获取一个值,通过该值指示当前 Type 是包含还是引用另一类型,即当前 Type 是数组、指针还是通过引用传递。
Public property Supported by the .NET Compact Framework IsAbstract 获取一个值,通过该值指示 Type 是否为抽象的并且必须被重写。
Public property Supported by the .NET Compact Framework IsAnsiClass 获取一个指示是否为 Type 选择了字符串格式属性 (Attribute) AnsiClass 的值。
Public property Supported by the .NET Compact Framework IsArray 获取一个值,通过该值指示 Type 是否为数组。
Public property Supported by the .NET Compact Framework IsAutoClass 获取一个值,通过该值指示是否为 Type 选定了字符串格式属性 (Attribute) AutoClass
Public property Supported by the .NET Compact Framework IsAutoLayout 获取一个指示是否为 Type 选择了类布局属性 (Attribute) AutoLayout 的值。
Public property Supported by the .NET Compact Framework IsByRef 获取一个值,通过该值指示 Type 是否由引用传递。
Public property Supported by the .NET Compact Framework IsClass 获取一个值,通过该值指示 Type 是否是一个类;即,不是值类型或接口。
Public property Supported by the .NET Compact Framework IsCOMObject 获取一个值,通过该值指示 Type 是否为 COM 对象。
Public property IsContextful 获取一个值,通过该值指示 Type 在上下文中是否可以被承载。
Public property Supported by the .NET Compact Framework IsEnum 获取一个值,该值指示当前的 Type 是否表示枚举。
Public property IsExplicitLayout 获取一个值,通过该值指示是否为 Type 选定了类布局属性 (Attribute) ExplicitLayout
Public property Supported by the .NET Compact Framework IsGenericParameter 获取一个值,该值指示当前 Type 是否表示泛型类型或方法的定义中的类型参数。
Public property Supported by the .NET Compact Framework IsGenericType 获取一个值,该值指示当前类型是否是泛型类型。
Public property Supported by the .NET Compact Framework IsGenericTypeDefinition 获取一个值,该值指示当前 Type 是否表示可以用来构造其他泛型类型的泛型类型定义。
Public property Supported by the .NET Compact Framework IsImport 获取一个值,该值指示 Type 是否应用了 ComImportAttribute 属性,如果应用了该属性,则表示它是从 COM 类型库导入的。
Public property Supported by the .NET Compact Framework IsInterface 获取一个值,通过该值指示 Type 是否为接口(即不是类或值类型)。
Public property IsLayoutSequential 获取一个值,通过该值指示是否为 Type 选定了类布局属性 (Attribute) SequentialLayout
Public property IsMarshalByRef 获取一个值,该值指示 Type 是否按引用进行封送。
Public property IsNested 获取一个指示当前 Type 对象是否表示其定义嵌套在另一个类型的定义之内的类型的值。
Public property Supported by the .NET Compact Framework IsNestedAssembly 获取一个值,通过该值指示 Type 是否是嵌套的并且只能在它自己的程序集内可见。
Public property Supported by the .NET Compact Framework IsNestedFamANDAssem 获取一个值,通过该值指示 Type 是否是嵌套的并且只对同时属于自己家族和自己程序集的类可见。
Public property Supported by the .NET Compact Framework IsNestedFamily 获取一个值,通过该值指示 Type 是否是嵌套的并且只在它自己的家族内可见。
Public property Supported by the .NET Compact Framework IsNestedFamORAssem 获取一个值,通过该值指示 Type 是否是嵌套的并且只对属于它自己的家族或它自己的程序集的类可见。
Public property Supported by the .NET Compact Framework IsNestedPrivate 获取一个值,通过该值指示 Type 是否是嵌套的并声明为私有。
Public property Supported by the .NET Compact Framework IsNestedPublic 获取一个值,通过该值指示类是否是嵌套的并且声明为公共的。
Public property Supported by the .NET Compact Framework IsNotPublic 获取一个值,该值指示 Type 是否声明为公共类型。
Public property Supported by the .NET Compact Framework IsPointer 获取一个值,通过该值指示 Type 是否为指针。
Public property Supported by the .NET Compact Framework IsPrimitive 获取一个值,通过该值指示 Type 是否为基元类型之一。
Public property Supported by the .NET Compact Framework IsPublic 获取一个值,该值指示 Type 是否声明为公共类型。
Public property Supported by the .NET Compact Framework IsSealed 获取一个值,通过该值指示 Type 是否声明为密封的。
Public property IsSerializable 获取一个值,通过该值指示 Type 是否为可串行的。
Public property Supported by the .NET Compact Framework IsSpecialName 获取一个值,通过该值指示 Type 是否具有需要特殊处理的名称。
Public property Supported by the .NET Compact Framework IsUnicodeClass 获取一个值,通过该值指示是否为 Type 选定了字符串格式属性 (Attribute) UnicodeClass
Public property Supported by the .NET Compact Framework IsValueType 获取一个值,通过该值指示 Type 是否为值类型。
Public property Supported by the .NET Compact Framework IsVisible 获取一个指示 Type 是否可由程序集之外的代码访问的值。
Public property Supported by the .NET Compact Framework MemberType 获取一个指示此成员是类型还是嵌套类型的 MemberTypes 值。
Public property MetadataToken  获取一个值,该值标识元数据元素。(从 MemberInfo 继承。)
Public property Supported by the .NET Compact Framework Module 获取在其中定义当前 Type 的模块 (DLL)。
Public property Supported by the .NET Compact Framework Name  获取当前成员的名称。(从 MemberInfo 继承。)
Public property Supported by the .NET Compact Framework Namespace 获取 Type 的命名空间。
Public property Supported by the .NET Compact Framework ReflectedType 获取用于获取该成员的类对象。
Public property StructLayoutAttribute 获取一个描述当前类型的布局的 StructLayoutAttribute
Public property Supported by the .NET Compact Framework TypeHandle 获取当前 Type 的句柄。
Public property TypeInitializer 获取 Type 的初始值设定项。
Public property Supported by the .NET Compact Framework UnderlyingSystemType 指示表示该类型的公共语言运行库提供的类型。

页首

公共方法

(请参见 受保护的方法 )

  名称 说明
Public method Supported by the .NET Compact Framework Equals 已重载。 已重写。 确定当前 Type 的基础系统类型是否与指定 ObjectType 的基础系统类型相同。
Public method FindInterfaces 返回表示接口(由当前 Type 所实现或继承)的筛选列表的 Type 对象数组。
Public method FindMembers 返回指定成员类型的 MemberInfo 对象的筛选数组。
Public method Supported by the .NET Compact Framework GetArrayRank 获取 Array 中的维数。
Public method Supported by the .NET Compact Framework GetConstructor 已重载。 获取当前 Type 的特定构造函数。
Public method Supported by the .NET Compact Framework GetConstructors 已重载。 获取当前 Type 的构造函数。
Public method Supported by the .NET Compact Framework GetCustomAttributes  已重载。 在派生类中被重写时,返回应用于此成员的所有属性。 (从 MemberInfo 继承。)
Public method Supported by the .NET Compact Framework GetDefaultMembers 搜索为设置了 DefaultMemberAttribute 的当前 Type 定义的成员。
Public method Supported by the .NET Compact Framework GetElementType 当在派生类中重写时,返回当前数组、指针或引用类型包含的或引用的对象的 Type
Public method Supported by the .NET Compact Framework GetEvent 已重载。 获取由当前 Type 声明或继承的特定事件。
Public method Supported by the .NET Compact Framework GetEvents 已重载。 获取由当前 Type 声明或继承的事件。
Public method Supported by the .NET Compact Framework GetField 已重载。 获取当前 Type 的特定字段。
Public method Supported by the .NET Compact Framework GetFields 已重载。 获取当前 Type 的字段。
Public method Supported by the .NET Compact Framework GetGenericArguments 返回表示泛型类型的类型实参或泛型类型定义的类型形参的 Type 对象的数组。
Public method GetGenericParameterConstraints 返回表示当前泛型类型参数上的约束的 Type 对象的数组。
Public method Supported by the .NET Compact Framework GetGenericTypeDefinition 返回一个表示可用于构造当前泛型类型的泛型类型定义的 Type 对象。
Public method Supported by the .NET Compact Framework GetHashCode 已重写。 返回此实例的哈希代码。
Public method GetInterface 已重载。 获取由当前 Type 实现或继承的特定接口。
Public method GetInterfaceMap 返回指定接口类型的接口映射。
Public method Supported by the .NET Compact Framework GetInterfaces 当在派生类中重写时,获取由当前 Type 实现或继承的所有接口。
Public method Supported by the .NET Compact Framework GetMember 已重载。 获取当前 Type 的指定成员。
Public method Supported by the .NET Compact Framework GetMembers 已重载。 获取当前 Type 的成员(包括属性、方法、字段、事件等)。
Public method Supported by the .NET Compact Framework GetMethod 已重载。 获取当前 Type 的特定方法。
Public method Supported by the .NET Compact Framework GetMethods 已重载。 获取当前 Type 的方法。
Public method Supported by the .NET Compact Framework GetNestedType 已重载。 获取嵌套在当前 Type 中的特定类型。
Public method Supported by the .NET Compact Framework GetNestedTypes 已重载。 获取嵌套在当前 Type 中的类型。
Public method Supported by the .NET Compact Framework GetProperties 已重载。 获取当前 Type 的属性 (Property)。
Public method Supported by the .NET Compact Framework GetProperty 已重载。 获取当前 Type 的特定属性 (Property)。
Public method Supported by the .NET Compact Framework GetType 已重载。 获取表示指定类型的 Type 对象。
Public method Static GetTypeArray 获取指定数组中对象的类型。
Public method Static Supported by the .NET Compact Framework GetTypeCode 获取指定 Type 的基础类型代码。
Public method Static Supported by the .NET Compact Framework GetTypeFromCLSID 已重载。 获取与指定类标识符 (CLSID) 关联的类型。
Public method Static Supported by the .NET Compact Framework GetTypeFromHandle 获取由指定类型句柄引用的类型。
Public method Static Supported by the .NET Compact Framework GetTypeFromProgID 已重载。 获取与指定程序标识符 (ProgID) 关联的类型。
Public method Static GetTypeHandle 获取指定对象的 Type 的句柄。
Public method Supported by the .NET Compact Framework InvokeMember 已重载。 调用当前 Type 的特定成员。
Public method Supported by the .NET Compact Framework IsAssignableFrom 确定当前的 Type 的实例是否可以从指定 Type 的实例分配。
Public method Supported by the .NET Compact Framework IsDefined  在派生类中被重写时,指示是否 attributeType 的一个或多个实例应用于此成员。 (从 MemberInfo 继承。)
Public method Supported by the .NET Compact Framework IsInstanceOfType 确定指定的对象是否是当前 Type 的实例。
Public method Supported by the .NET Compact Framework IsSubclassOf 确定当前 Type 表示的类是否是从指定的 Type 表示的类派生的。
Public method MakeArrayType 已重载。 返回表示当前类型的数组的 Type 对象。
Public method MakeByRefType 返回表示作为 ref 参数(在 Visual Basic 中为 ByRef 参数)传递时的当前类型Type 对象。
Public method MakeGenericType 替代由当前泛型类型定义的类型参数组成的类型数组的元素,并返回表示结果构造类型的 Type 对象。
Public method MakePointerType 返回表示指向当前类型的指针的 Type 对象。
Public method Static Supported by the .NET Compact Framework ReferenceEquals  确定指定的 Object 实例是否是相同的实例。 (从 Object 继承。)
Public method Static ReflectionOnlyGetType 获取具有指定名称的 Type,指定是否执行区分大小写的搜索,以及在找不到类型时是否引发异常。该类型只为反射加载,而不为执行加载。
Public method Supported by the .NET Compact Framework ToString 已重写。 返回表示当前 Type 的名称的 String

页首

受保护的方法

  名称 说明
Protected method Supported by the .NET Compact Framework Finalize  允许 Object 在“垃圾回收”回收 Object 之前尝试释放资源并执行其他清理操作。 (从 Object 继承。)
Protected method Supported by the .NET Compact Framework GetAttributeFlagsImpl 当在派生类中重写时,实现 Attributes 属性 (Property),并获取指示与 Type 关联的属性 (Attribute) 的位屏蔽。
Protected method Supported by the .NET Compact Framework GetConstructorImpl 当在派生类中重写时,使用指定的绑定约束和指定的调用约定搜索其参数与指定的参数类型和修饰符匹配的构造函数。
Protected method Supported by the .NET Compact Framework GetMethodImpl 当在派生类中重写时,使用指定的绑定约束和指定的调用约定搜索其参数与指定的参数类型和修饰符匹配的指定方法。
Protected method Supported by the .NET Compact Framework GetPropertyImpl 当在派生类中重写时,使用指定的绑定约束搜索其参数与指定的参数类型和修饰符匹配的指定属性 (Property)。
Protected method Supported by the .NET Compact Framework HasElementTypeImpl 当在派生类中重写时,实现 HasElementType 属性 (Property),确定当前 Type 是否包含另一类型或对其引用;即,当前 Type 是否是数组、指针或由引用传递。
Protected method Supported by the .NET Compact Framework IsArrayImpl 当在派生类中重写时,实现 IsArray 属性并确定 Type 是否为数组。
Protected method Supported by the .NET Compact Framework IsByRefImpl 当在派生类中重写时,实现 IsByRef 属性并确定 Type 是否由引用传递。
Protected method Supported by the .NET Compact Framework IsCOMObjectImpl 当在派生类中重写时,实现 IsCOMObject 属性并确定 Type 是否为 COM 对象。
Protected method IsContextfulImpl 实现 IsContextful 属性 (Property) 并确定 Type 在上下文中是否可以被承载。
Protected method IsMarshalByRefImpl 实现 IsMarshalByRef 属性并确定 Type 是否按引用来进行封送。
Protected method Supported by the .NET Compact Framework IsPointerImpl 当在派生类中重写时,实现 IsPointer 属性并确定 Type 是否为指针。
Protected method Supported by the .NET Compact Framework IsPrimitiveImpl 当在派生类中重写时,实现 IsPrimitive 属性并确定 Type 是否为基元类型之一。
Protected method Supported by the .NET Compact Framework IsValueTypeImpl 实现 IsValueType 属性 (Property) 并确定 Type 是否是值类型;即,它不是类或接口。
Protected method Supported by the .NET Compact Framework MemberwiseClone  创建当前 Object 的浅表副本。 (从 Object 继承。)

页首

显式接口实现

  名称 说明
Explicit interface implementation Method System.Runtime.InteropServices._Type.GetIDsOfNames 将一组名称映射为对应的一组调度标识符。
Explicit interface implementation Method System.Runtime.InteropServices._Type.GetTypeInfo 检索对象的类型信息,然后可以使用该信息获取接口的类型信息。
Explicit interface implementation Method System.Runtime.InteropServices._Type.GetTypeInfoCount 检索对象提供的类型信息接口的数量(0 或 1)。
Explicit interface implementation Method System.Runtime.InteropServices._Type.Invoke 提供对某一对象公开的属性 (Property) 和方法的访问。

页首

请参见

参考

Type 类
System 命名空间
Object 类
System.Reflection
ReflectionPermission