Type Класс
Определение
Представляет объявления типов для классов, интерфейсов, массивов, значений, перечислений параметров, определений универсальных типов и открытых или закрытых сконструированных универсальных типов.Represents type declarations: class types, interface types, array types, value types, enumeration types, type parameters, generic type definitions, and open or closed constructed generic types.
public ref class Type abstract
public ref class Type abstract : System::Reflection::MemberInfo, System::Reflection::IReflect
public ref class Type abstract : System::Reflection::MemberInfo, System::Reflection::IReflect, System::Runtime::InteropServices::_Type
public abstract class Type
public abstract class Type : System.Reflection.MemberInfo, System.Reflection.IReflect
[System.Runtime.InteropServices.ClassInterface(System.Runtime.InteropServices.ClassInterfaceType.None)]
[System.Serializable]
public abstract class Type : System.Reflection.MemberInfo, System.Reflection.IReflect, System.Runtime.InteropServices._Type
[System.Runtime.InteropServices.ClassInterface(System.Runtime.InteropServices.ClassInterfaceType.None)]
[System.Serializable]
[System.Runtime.InteropServices.ComVisible(true)]
public abstract class Type : System.Reflection.MemberInfo, System.Reflection.IReflect, System.Runtime.InteropServices._Type
type Type = class
type Type = class
inherit MemberInfo
interface IReflect
[<System.Runtime.InteropServices.ClassInterface(System.Runtime.InteropServices.ClassInterfaceType.None)>]
[<System.Serializable>]
type Type = class
inherit MemberInfo
interface _Type
interface IReflect
[<System.Runtime.InteropServices.ClassInterface(System.Runtime.InteropServices.ClassInterfaceType.None)>]
[<System.Serializable>]
[<System.Runtime.InteropServices.ComVisible(true)>]
type Type = class
inherit MemberInfo
interface _Type
interface IReflect
Public MustInherit Class Type
Public MustInherit Class Type
Inherits MemberInfo
Implements IReflect
Public MustInherit Class Type
Inherits MemberInfo
Implements _Type, IReflect
- Наследование
-
Type
- Наследование
- Производный
- Атрибуты
- Реализации
Примеры
В следующем примере показаны несколько репрезентативных функций Type .The following example shows a few representative features of Type. Оператор C# typeof
( GetType
оператор в Visual Basic) используется для получения Type объекта, представляющего String .The C# typeof
operator (GetType
operator in Visual Basic) is used to get a Type object representing String. Из этого Type объекта GetMethod метод используется для получения объекта, MethodInfo представляющего String.Substring перегрузку, которая принимает начальное расположение и длину.From this Type object, the GetMethod method is used to get a MethodInfo representing the String.Substring overload that takes a starting location and a length.
Для обнаружения сигнатуры перегрузки в примере кода создается временный массив, содержащий два Type объекта, представляющие int
( Integer
в Visual Basic).To identify the overload signature, the code example creates a temporary array containing two Type objects representing int
(Integer
in Visual Basic).
Примечание
Чтобы быть точным, массив содержит две ссылки на экземпляр Type , который представляется int
в текущем домене приложения.To be precise, the array contains two references to the instance of Type that represents int
in the current application domain. Для любого типа существует только один экземпляр для Type каждого домена приложения.For any type, there is only one instance of Type per application domain.
В примере кода используется MethodInfo для вызова Substring метода в строке "Hello, World!" и отображения результата.The code example uses the MethodInfo to invoke the Substring method on the string "Hello, World!", and displays the result.
#using <System.dll>
using namespace System;
using namespace System::Reflection;
void main()
{
// Get a Type object representing the System.String type.
Type^ t = String::typeid;
MethodInfo^ substr = t->GetMethod("Substring",
gcnew array<Type^> { int::typeid, int::typeid });
Object^ result =
substr->Invoke("Hello, World!", gcnew array<Object^> { 7, 5 });
Console::WriteLine("{0} returned \"{1}\".", substr, result);
}
/* This code example produces the following output:
System.String Substring(Int32, Int32) returned "World".
*/
using System;
using System.Reflection;
class Example
{
static void Main()
{
Type t = typeof(String);
MethodInfo substr = t.GetMethod("Substring",
new Type[] { typeof(int), typeof(int) });
Object result =
substr.Invoke("Hello, World!", new Object[] { 7, 5 });
Console.WriteLine("{0} returned \"{1}\".", substr, result);
}
}
/* This code example produces the following output:
System.String Substring(Int32, Int32) returned "World".
*/
Imports System.Reflection
Module Example
Sub Main()
Dim t As Type = GetType(String)
Dim substr As MethodInfo = t.GetMethod("Substring", _
New Type() { GetType(Integer), GetType(Integer) })
Dim result As Object = _
substr.Invoke("Hello, World!", New Object() { 7, 5 })
Console.WriteLine("{0} returned ""{1}"".", substr, result)
End Sub
End Module
' This code example produces the following output:
'
'System.String Substring(Int32, Int32) returned "World".
Комментарии
Type
является корнем System.Reflection функциональности и является основным способом доступа к метаданным.Type
is the root of the System.Reflection functionality and is the primary way to access metadata. Члены класса используются Type для получения сведений об объявлении типа, о членах типа (таких как конструкторы, методы, поля, свойства и события класса), а также о модуле и сборке, в которой развернут класс.Use the members of Type to get information about a type declaration, about the members of a type (such as the constructors, methods, fields, properties, and events of a class), as well as the module and the assembly in which the class is deployed.
Разрешения не требуются, чтобы код использовал отражение для получения сведений о типах и их членах, независимо от их уровней доступа.No permissions are required for code to use reflection to get information about types and their members, regardless of their access levels. Разрешения не требуются, чтобы код использовал отражение для доступа к открытым членам или другим членам, уровни доступа которых станут видимыми во время обычной компиляции.No permissions are required for code to use reflection to access public members, or other members whose access levels would make them visible during normal compilation. Однако, чтобы код использовал отражение для доступа к членам, которые обычно недоступны, например закрытые или внутренние методы, или защищенные поля типа, который не наследуется классом, код должен иметь ReflectionPermission .However, in order for your code to use reflection to access members that would normally be inaccessible, such as private or internal methods, or protected fields of a type your class does not inherit, your code must have ReflectionPermission. См. раздел вопросы безопасности при отражении.See Security Considerations for Reflection.
Type
является абстрактным базовым классом, который допускает несколько реализаций.Type
is an abstract base class that allows multiple implementations. Система всегда будет предоставлять производный класс RuntimeType
.The system will always provide the derived class RuntimeType
. В отражении все классы, начинающиеся со слова Runtime, создаются только один раз для каждого объекта в системе и поддерживают операции сравнения.In reflection, all classes beginning with the word Runtime are created only once per object in the system and support comparison operations.
Примечание
В сценариях многопоточности не блокируйте Type объекты для синхронизации доступа к static
данным.In multithreading scenarios, do not lock Type objects in order to synchronize access to static
data. Другой код, для которого нет элемента управления, может также заблокировать тип класса.Other code, over which you have no control, might also lock your class type. Это может привести к взаимоблокировке.This might result in a deadlock. Вместо этого следует синхронизировать доступ к статическим данным путем блокировки закрытого static
объекта.Instead, synchronize access to static data by locking a private static
object.
Примечание
Производный класс может обращаться к защищенным членам базовых классов вызывающего кода.A derived class can access protected members of the calling code's base classes. Кроме того, доступ к членам сборки вызывающего кода разрешен.Also, access is allowed to assembly members of the calling code's assembly. Как правило, если доступ разрешен в коде с ранней привязкой, доступ к нему также разрешен в коде с поздним связыванием.As a rule, if you are allowed access in early-bound code, then you are also allowed access in late-bound code.
Примечание
Интерфейсы, расширяющие другие интерфейсы, не наследуют методы, определенные в расширенных интерфейсах.Interfaces that extend other interfaces do not inherit the methods defined in the extended interfaces.
СодержаниеIn this section:
Какие типы представляет объект типа? What types does a Type object represent?
Получение объекта типа Retrieving a Type object
Сравнение объектов типа на равенствоComparing type objects for equality
Какие типы представляет объект типа?What types does a Type object represent?
Этот класс является потокобезопасным; несколько потоков могут одновременно считывать из экземпляра этого типа.This class is thread safe; multiple threads can concurrently read from an instance of this type. Экземпляр Type класса может представлять любой из следующих типов:An instance of the Type class can represent any of the following types:
КлассыClasses
Типы значенийValue types
МассивыArrays
интерфейсов,Interfaces
ПеречисленияEnumerations
ДелегатыDelegates
Сконструированные универсальные типы и определения универсальных типовConstructed generic types and generic type definitions
Аргументы типа и параметры типов сконструированных универсальных типов, определений универсальных типов и определений универсальных методовType arguments and type parameters of constructed generic types, generic type definitions, and generic method definitions
Получение объекта типаRetrieving a Type object
TypeОбъект, связанный с определенным типом, можно получить следующими способами.The Type object associated with a particular type can be obtained in the following ways:
Метод экземпляра Object.GetType возвращает Type объект, представляющий тип экземпляра.The instance Object.GetType method returns a Type object that represents the type of an instance. Поскольку все управляемые типы являются производными от Object , GetType метод может быть вызван для экземпляра любого типа.Because all managed types derive from Object, the GetType method can be called on an instance of any type.
В следующем примере вызывается Object.GetType метод для определения типа среды выполнения каждого объекта в массиве объектов.The following example calls the Object.GetType method to determine the runtime type of each object in an object array.
using namespace System; void main() { array<Object^>^ values = { "word", true, 120, 136.34 }; for each (Object^ value in values) Console::WriteLine("{0} - type {1}", value, value->GetType()->Name); } // The example displays the following output: // word - type String // True - type Boolean // 120 - type Int32 // 136.34 - type Double
object[] values = { "word", true, 120, 136.34, 'a' }; foreach (var value in values) Console.WriteLine("{0} - type {1}", value, value.GetType().Name); // The example displays the following output: // word - type String // True - type Boolean // 120 - type Int32 // 136.34 - type Double // a - type Char
Module Example Public Sub Main() Dim values() As Object = { "word", True, 120, 136.34, "a"c } For Each value In values Console.WriteLine("{0} - type {1}", value, value.GetType().Name) Next End Sub End Module ' The example displays the following output: ' word - type String ' True - type Boolean ' 120 - type Int32 ' 136.34 - type Double ' a - type Char
Статические Type.GetType методы возвращают Type объект, представляющий тип, указанный с помощью его полного имени.The static Type.GetType methods return a Type object that represents a type specified by its fully qualified name.
Module.GetTypesМетоды, Module.GetType и Module.FindTypes возвращают
Type
объекты, представляющие типы, определенные в модуле.The Module.GetTypes, Module.GetType, and Module.FindTypes methods returnType
objects that represent the types defined in a module. Первый метод можно использовать для получения массива Type объектов для всех открытых и закрытых типов, определенных в модуле.The first method can be used to obtain an array of Type objects for all the public and private types defined in a module. (Экземпляр можно получитьModule
с помощью Assembly.GetModule Assembly.GetModules метода или или через Type.Module свойство.)(You can obtain an instance ofModule
through the Assembly.GetModule or Assembly.GetModules method, or through the Type.Module property.)System.Reflection.AssemblyОбъект содержит ряд методов для получения классов, определенных в сборке, включая Assembly.GetType , Assembly.GetTypes и Assembly.GetExportedTypes .The System.Reflection.Assembly object contains a number of methods to retrieve the classes defined in an assembly, including Assembly.GetType, Assembly.GetTypes, and Assembly.GetExportedTypes.
FindInterfacesМетод возвращает отфильтрованный список типов интерфейса, поддерживаемых типом.The FindInterfaces method returns a filtered list of interface types supported by a type.
GetElementTypeМетод возвращает
Type
объект, представляющий элемент.The GetElementType method returns aType
object that represents the element.GetInterfacesМетоды и GetInterface возвращают Type объекты, представляющие типы интерфейсов, поддерживаемые типом.The GetInterfaces and GetInterface methods return Type objects representing the interface types supported by a type.
GetTypeArrayМетод возвращает массив Type объектов, представляющих типы, заданные произвольным набором объектов.The GetTypeArray method returns an array of Type objects representing the types specified by an arbitrary set of objects. Объекты указываются с помощью массива типа Object .The objects are specified with an array of type Object.
GetTypeFromProgIDМетоды и GetTypeFromCLSID предоставляются для COM-взаимодействия.The GetTypeFromProgID and GetTypeFromCLSID methods are provided for COM interoperability. Они возвращают Type объект, представляющий тип, заданный параметром
ProgID
илиCLSID
.They return a Type object that represents the type specified by aProgID
orCLSID
.GetTypeFromHandleМетод обеспечивает взаимодействие.The GetTypeFromHandle method is provided for interoperability. Он возвращает
Type
объект, представляющий тип, указанный в обработчике класса.It returns aType
object that represents the type specified by a class handle.Оператор C#
typeof
,typeid
оператор C++ иGetType
оператор Visual Basic получаютType
объект для типа.The C#typeof
operator, the C++typeid
operator, and the Visual BasicGetType
operator obtain theType
object for a type.MakeGenericTypeМетод возвращает объект, Type представляющий сконструированный универсальный тип, который является открытым сконструированным типом, если его ContainsGenericParameters свойство возвращает
true
, а закрытый сконструированный тип — в противном случае.The MakeGenericType method returns a Type object representing a constructed generic type, which is an open constructed type if its ContainsGenericParameters property returnstrue
, and a closed constructed type otherwise. Универсальный тип можно создать только в том случае, если он закрыт.A generic type can be instantiated only if it is closed.MakeArrayTypeМетоды, MakePointerType и MakeByRefType возвращают Type объекты, представляющие соответственно массив указанного типа, указатель на указанный тип и тип ссылочного параметра (
ref
в C#,ByRef
в Visual Basic).The MakeArrayType, MakePointerType, and MakeByRefType methods return Type objects that represent, respectively, an array of a specified type, a pointer to a specified type, and the type of a reference parameter (ref
in C#,ByRef
in Visual Basic).
Сравнение объектов типа на равенствоComparing type objects for equality
TypeОбъект, представляющий тип, является уникальным; то есть две ссылки на Type объекты ссылаются на один и тот же объект, только если они представляют один и тот же тип.A Type object that represents a type is unique; that is, two Type object references refer to the same object if and only if they represent the same type. Это позволяет сравнивать объекты, Type используя равенство ссылок.This allows for comparison of Type objects using reference equality. В следующем примере сравниваются Type объекты, представляющие число целочисленных значений, чтобы определить, относятся ли они к одному типу.The following example compares the Type objects that represent a number of integer values to determine whether they are of the same type.
using namespace System;
void main()
{
Int64 number1 = 1635429;
Int32 number2 = 16203;
double number3 = 1639.41;
Int64 number4 = 193685412;
// Get the type of number1.
Type^ t = number1.GetType();
// Compare types of all objects with number1.
Console::WriteLine("Type of number1 and number2 are equal: {0}",
Object::ReferenceEquals(t, number2.GetType()));
Console::WriteLine("Type of number1 and number3 are equal: {0}",
Object::ReferenceEquals(t, number3.GetType()));
Console::WriteLine("Type of number1 and number4 are equal: {0}",
Object::ReferenceEquals(t, number4.GetType()));
}
// The example displays the following output:
// Type of number1 and number2 are equal: False
// Type of number1 and number3 are equal: False
// Type of number1 and number4 are equal: True
long number1 = 1635429;
int number2 = 16203;
double number3 = 1639.41;
long number4 = 193685412;
// Get the type of number1.
Type t = number1.GetType();
// Compare types of all objects with number1.
Console.WriteLine("Type of number1 and number2 are equal: {0}",
Object.ReferenceEquals(t, number2.GetType()));
Console.WriteLine("Type of number1 and number3 are equal: {0}",
Object.ReferenceEquals(t, number3.GetType()));
Console.WriteLine("Type of number1 and number4 are equal: {0}",
Object.ReferenceEquals(t, number4.GetType()));
// The example displays the following output:
// Type of number1 and number2 are equal: False
// Type of number1 and number3 are equal: False
// Type of number1 and number4 are equal: True
Module Example
Public Sub Main()
Dim number1 As Long = 1635429
Dim number2 As Integer = 16203
Dim number3 As Double = 1639.41
Dim number4 As Long = 193685412
' Get the type of number1.
Dim t As Type = number1.GetType()
' Compare types of all objects with number1.
Console.WriteLine("Type of number1 and number2 are equal: {0}",
Object.ReferenceEquals(t, number2.GetType()))
Console.WriteLine("Type of number1 and number3 are equal: {0}",
Object.ReferenceEquals(t, number3.GetType()))
Console.WriteLine("Type of number1 and number4 are equal: {0}",
Object.ReferenceEquals(t, number4.GetType()))
End Sub
End Module
' The example displays the following output:
' Type of number1 and number2 are equal: False
' Type of number1 and number3 are equal: False
' Type of number1 and number4 are equal: True
Примечания для тех, кто реализует этот метод
При наследовании из необходимо Type
переопределить следующие члены:When you inherit from Type
, you must override the following members:
GetConstructorImpl(BindingFlags, Binder, CallingConventions, Type[], ParameterModifier[])
GetMethodImpl(String, BindingFlags, Binder, CallingConventions, Type[], ParameterModifier[])
GetPropertyImpl(String, BindingFlags, Binder, Type, Type[], ParameterModifier[])
Конструкторы
Type() |
Инициализирует новый экземпляр класса Type.Initializes a new instance of the Type class. |
Поля
Delimiter |
Разделяет имена в пространстве имен класса Type.Separates names in the namespace of the Type. Это поле доступно только для чтения.This field is read-only. |
EmptyTypes |
Представляет пустой массив типа Type.Represents an empty array of type Type. Это поле доступно только для чтения.This field is read-only. |
FilterAttribute |
Предоставляет фильтр членов, используемый для атрибутов.Represents the member filter used on attributes. Это поле доступно только для чтения.This field is read-only. |
FilterName |
Представляет фильтр членов с учетом регистра, применяемый к именам.Represents the case-sensitive member filter used on names. Это поле доступно только для чтения.This field is read-only. |
FilterNameIgnoreCase |
Представляет фильтр членов без учета регистра, применяемый к именам.Represents the case-insensitive member filter used on names. Это поле доступно только для чтения.This field is read-only. |
Missing |
Представляет отсутствующее значение в данных объекта Type.Represents a missing value in the Type information. Это поле доступно только для чтения.This field is read-only. |
Свойства
Assembly |
Возвращает объект Assembly, в котором объявлен тип.Gets the Assembly in which the type is declared. Для универсальных типов возвращает объект сборки Assembly, в которой определен универсальный тип.For generic types, gets the Assembly in which the generic type is defined. |
AssemblyQualifiedName |
Возвращает имя типа с указанием сборки, включающее имя сборки, из которой был загружен объект Type.Gets the assembly-qualified name of the type, which includes the name of the assembly from which this Type object was loaded. |
Attributes |
Возвращает атрибуты, связанные с объектом Type.Gets the attributes associated with the Type. |
BaseType |
Возвращает тип, для которого текущий объект Type является непосредственным наследником.Gets the type from which the current Type directly inherits. |
ContainsGenericParameters |
Возвращает значение, позволяющее определить, имеются ли у текущего объекта Type параметры типа, которые не были замещены указанными типами.Gets a value indicating whether the current Type object has type parameters that have not been replaced by specific types. |
CustomAttributes |
Получает коллекцию, содержащую пользовательские атрибуты этого члена.Gets a collection that contains this member's custom attributes. (Унаследовано от MemberInfo) |
DeclaringMethod |
Возвращает метод MethodBase, который представляет объявляемый метод, если текущий Type представляет параметр типа универсального метода.Gets a MethodBase that represents the declaring method, if the current Type represents a type parameter of a generic method. |
DeclaringType |
Возвращает тип, объявивший текущий вложенный тип или параметр универсального типа.Gets the type that declares the current nested type or generic type parameter. |
DefaultBinder |
Возвращает ссылку на связыватель по умолчанию, который реализует внутренние правила выбора соответствующих членов, вызываемых методом InvokeMember(String, BindingFlags, Binder, Object, Object[], ParameterModifier[], CultureInfo, String[]).Gets a reference to the default binder, which implements internal rules for selecting the appropriate members to be called by InvokeMember(String, BindingFlags, Binder, Object, Object[], ParameterModifier[], CultureInfo, String[]). |
FullName |
Возвращает полное имя типа, включая пространство имен, но не сборку.Gets the fully qualified name of the type, including its namespace but not its assembly. |
GenericParameterAttributes |
Возвращает сочетание флагов GenericParameterAttributes, описывающих ковариацию и особые ограничения текущего параметра универсального типа.Gets a combination of GenericParameterAttributes flags that describe the covariance and special constraints of the current generic type parameter. |
GenericParameterPosition |
Возвращает позицию параметра типа в списке параметров универсального типа или метода, который объявил параметр, если объект Type представляет параметр универсального типа или метода.Gets the position of the type parameter in the type parameter list of the generic type or method that declared the parameter, when the Type object represents a type parameter of a generic type or a generic method. |
GenericTypeArguments |
Получает массив аргументов универсального типа для этого типа.Gets an array of the generic type arguments for this type. |
GUID |
Возвращает идентификатор GUID, связанный с объектом Type.Gets the GUID associated with the Type. |
HasElementType |
Возвращает значение, позволяющее определить, содержит ли текущий объект Type в себе другой тип или ссылку на другой тип (иными словами, является ли текущий объект Type массивом, указателем либо параметром или же он передается по ссылке).Gets a value indicating whether the current Type encompasses or refers to another type; that is, whether the current Type is an array, a pointer, or is passed by reference. |
IsAbstract |
Возвращает значение, показывающее, является ли данный объект Type абстрактным объектом, который должен быть переопределен.Gets a value indicating whether the Type is abstract and must be overridden. |
IsAnsiClass |
Возвращает значение, позволяющее определить, выбран ли для объекта |
IsArray |
Возвращает значение, показывающее, является ли тип массивом.Gets a value that indicates whether the type is an array. |
IsAutoClass |
Возвращает значение, позволяющее определить, выбран ли для объекта |
IsAutoLayout |
Получает значение, указывающее, выкладываются ли поля текущего типа автоматически средой CLR.Gets a value indicating whether the fields of the current type are laid out automatically by the common language runtime. |
IsByRef |
Возвращает значение, указывающее, передан ли объект Type по ссылке.Gets a value indicating whether the Type is passed by reference. |
IsByRefLike |
Возвращает значение, показывающее, является ли тип структурой, подобной ByRef.Gets a value that indicates whether the type is a byref-like structure. |
IsClass |
Получает значение, позволяющее определить, является объект Type классом или делегатом (иными словами, не является типом значения или интерфейсом).Gets a value indicating whether the Type is a class or a delegate; that is, not a value type or interface. |
IsCollectible |
Получает значение, указывающее, является ли объект MemberInfo частью сборки, содержащейся в забираемом контексте AssemblyLoadContext.Gets a value that indicates whether this MemberInfo object is part of an assembly held in a collectible AssemblyLoadContext. (Унаследовано от MemberInfo) |
IsCOMObject |
Возвращает значение, указывающее, является ли объект Type COM-объектом.Gets a value indicating whether the Type is a COM object. |
IsConstructedGenericType |
Возвращает значение, указывающее, представляет ли этот данный объект сконструированный универсальный тип.Gets a value that indicates whether this object represents a constructed generic type. Можно создать экземпляры сконструированного универсального типа.You can create instances of a constructed generic type. |
IsContextful |
Возвращает значение, позволяющее определить, можно ли поместить в контекст объект Type.Gets a value indicating whether the Type can be hosted in a context. |
IsEnum |
Возвращает значение, позволяющее определить, представляет ли текущий объект Type перечисление.Gets a value indicating whether the current Type represents an enumeration. |
IsExplicitLayout |
Возвращает значение, указывающее, выкладываются ли поля текущего типа с явно заданными смещениями.Gets a value indicating whether the fields of the current type are laid out at explicitly specified offsets. |
IsGenericMethodParameter |
Получает значение, позволяющее определить, представляет ли текущий объект Type параметр типа в определении универсального метода.Gets a value that indicates whether the current Type represents a type parameter in the definition of a generic method. |
IsGenericParameter |
Возвращает значение, позволяющее определить, представляет ли текущий объект Type параметр типа в определении универсального типа или метода.Gets a value indicating whether the current Type represents a type parameter in the definition of a generic type or method. |
IsGenericType |
Возвращает значение, указывающее, является ли текущий тип универсальным.Gets a value indicating whether the current type is a generic type. |
IsGenericTypeDefinition |
Возвращает значение, позволяющее определить, представляет ли текущий объект Type определение универсального типа, на основе которого можно сконструировать другие универсальные типы.Gets a value indicating whether the current Type represents a generic type definition, from which other generic types can be constructed. |
IsGenericTypeParameter |
Получает значение, позволяющее определить, представляет ли текущий объект Type параметр типа в определении универсального типа.Gets a value that indicates whether the current Type represents a type parameter in the definition of a generic 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. |
IsInterface |
Возвращает значение, позволяющее определить, является ли объект Type интерфейсом (иными словами, не является классом или типом значения).Gets a value indicating whether the Type is an interface; that is, not a class or a value type. |
IsLayoutSequential |
Возвращает значение, указывающее, выкладываются ли поля текущего типа последовательно, в том порядке, в котором они были определены, или выдаются в метаданные.Gets a value indicating whether the fields of the current type are laid out sequentially, in the order that they were defined or emitted to the metadata. |
IsMarshalByRef |
Возвращает значение, указывающее, маршалирован ли объект Type по ссылке.Gets a value indicating whether the Type is marshaled by reference. |
IsNested |
Возвращает значение, позволяющее определить, представляет ли текущий объект Type тип, определение которого вложено в определение другого типа.Gets a value indicating whether the current Type object represents a type whose definition is nested inside the definition of another type. |
IsNestedAssembly |
Возвращает значение, позволяющее определить, является ли объект Type вложенным и видимым только в своей сборке.Gets a value indicating whether the Type is nested and visible only within its own assembly. |
IsNestedFamANDAssem |
Возвращает значение, позволяющее определить, является ли объект Type вложенным и видимым только для классов, принадлежащих одновременно к семейству и сборке этого объекта.Gets a value indicating whether the Type is nested and visible only to classes that belong to both its own family and its own assembly. |
IsNestedFamily |
Возвращает значение, позволяющее определить, является ли объект Type вложенным и видимым только в своем семействе.Gets a value indicating whether the Type is nested and visible only within its own family. |
IsNestedFamORAssem |
Возвращает значение, позволяющее определить, является ли данный объект Type вложенным и видимым только для классов, принадлежащих либо к его семейству, либо к его сборке.Gets a value indicating whether the Type is nested and visible only to classes that belong to either its own family or to its own assembly. |
IsNestedPrivate |
Возвращает значение, позволяющее определить, является ли объект Type вложенным и объявленным как закрытый.Gets a value indicating whether the Type is nested and declared private. |
IsNestedPublic |
Возвращает значение, позволяющее определить, является ли класс вложенным и объявленным как открытый.Gets a value indicating whether a class is nested and declared public. |
IsNotPublic |
Возвращает значение, позволяющее определить, не был ли объект Type объявлен как открытый.Gets a value indicating whether the Type is not declared public. |
IsPointer |
Возвращает значение, указывающее, является ли объект Type указателем.Gets a value indicating whether the Type is a pointer. |
IsPrimitive |
Возвращает значение, указывающее, является ли Type одним из типов-примитивов.Gets a value indicating whether the Type is one of the primitive types. |
IsPublic |
Возвращает значение, позволяющее определить, был ли объект Type объявлен как открытый.Gets a value indicating whether the Type is declared public. |
IsSealed |
Возвращает значение, позволяющее определить, был ли объект Type объявлен как запечатанный.Gets a value indicating whether the Type is declared sealed. |
IsSecurityCritical |
Возвращает значение, которое указывает, является ли текущий тип критически важным для безопасности или защищенным критически важным для безопасности на данном уровне доверия и, следовательно, может ли он выполнять критические операции.Gets a value that indicates whether the current type is security-critical or security-safe-critical at the current trust level, and therefore can perform critical operations. |
IsSecuritySafeCritical |
Возвращает значение, которое указывает, является ли текущий тип защищенным критически важным для безопасности на текущем уровне доверия и, следовательно, может ли он выполнять критические операции и предоставлять доступ прозрачному коду.Gets a value that indicates whether the current type is security-safe-critical at the current trust level; that is, whether it can perform critical operations and can be accessed by transparent code. |
IsSecurityTransparent |
Получает значение, которое указывает, является ли текущий тип прозрачным на текущем уровне доверия и, следовательно, не может выполнять критические операции.Gets a value that indicates whether the current type is transparent at the current trust level, and therefore cannot perform critical operations. |
IsSerializable |
Возвращает значение, позволяющее определить, сериализуем ли объект Type.Gets a value indicating whether the Type is serializable. |
IsSignatureType |
Возвращает значение, показывающее, является ли тип типом сигнатуры.Gets a value that indicates whether the type is a signature type. |
IsSpecialName |
Возвращает значение, позволяющее определить, требует ли имя данного объекта специальной обработки.Gets a value indicating whether the type has a name that requires special handling. |
IsSZArray |
Возвращает значение, указывающее, является ли тип типом массива, который может представлять только одномерный массив с нулевой нижней границей.Gets a value that indicates whether the type is an array type that can represent only a single-dimensional array with a zero lower bound. |
IsTypeDefinition |
Возвращает значение, показывающее, является ли тип определением типа.Gets a value that indicates whether the type is a type definition. |
IsUnicodeClass |
Возвращает значение, позволяющее определить, выбран ли для объекта |
IsValueType |
Возвращает значение, позволяющее определить, является ли объект Type типом значения.Gets a value indicating whether the Type is a value type. |
IsVariableBoundArray |
Возвращает значение, указывающее, является ли тип типом массива, который может представлять многомерный массив или массив с произвольной нижней границей.Gets a value that indicates whether the type is an array type that can represent a multi-dimensional array or an array with an arbitrary lower bound. |
IsVisible |
Возвращает значение, позволяющее определить, можно ли получить доступ к объекту Type из кода за пределами сборки.Gets a value indicating whether the Type can be accessed by code outside the assembly. |
MemberType |
Возвращает значение MemberTypes, позволяющее определить, каким типом является этот член: обычным или вложенным.Gets a MemberTypes value indicating that this member is a type or a nested type. |
MetadataToken |
Получает значение, определяющее элемент метаданных.Gets a value that identifies a metadata element. (Унаследовано от MemberInfo) |
Module |
Возвращает модуль (DLL), в котором определен текущий объект Type.Gets the module (the DLL) in which the current Type is defined. |
Name |
При переопределении в производном классе получает имя текущего типа.When overridden in a derived class, gets the name of the current type. |
Name |
Возвращает имя текущего члена.Gets the name of the current member. (Унаследовано от MemberInfo) |
Namespace |
Возвращает пространство имен объекта Type.Gets the namespace of the Type. |
ReflectedType |
Возвращает объект класса, который использовался для получения этого члена.Gets the class object that was used to obtain this member. |
StructLayoutAttribute |
Возвращает атрибут StructLayoutAttribute, описывающий структуру текущего типа.Gets a StructLayoutAttribute that describes the layout of the current type. |
TypeHandle |
Возвращает дескриптор текущего объекта Type.Gets the handle for the current Type. |
TypeInitializer |
Возвращает инициализатор типа.Gets the initializer for the type. |
UnderlyingSystemType |
Указывает на тип, предоставляемый средой CLR, представляющей этот тип.Indicates the type provided by the common language runtime that represents this type. |
Методы
Equals(Object) |
Определяет, совпадает ли базовый системный тип текущего объекта Type с базовым системным типом указанного объекта Object.Determines if the underlying system type of the current Type object is the same as the underlying system type of the specified Object. |
Equals(Type) |
Позволяет определить, совпадает ли базовый системный тип текущего объекта Type с базовым системным типом указанного объекта Type.Determines if the underlying system type of the current Type is the same as the underlying system type of the specified Type. |
FindInterfaces(TypeFilter, Object) |
Возвращает массив объектов Type, представляющий отфильтрованный список интерфейсов, реализованных или наследуемых текущим объектом Type.Returns an array of Type objects representing a filtered list of interfaces implemented or inherited by the current Type. |
FindMembers(MemberTypes, BindingFlags, MemberFilter, Object) |
Возвращает отфильтрованный массив объектов MemberInfo, тип которого совпадает с указанным типом члена.Returns a filtered array of MemberInfo objects of the specified member type. |
GetArrayRank() |
Возвращает размерность массива.Gets the number of dimensions in an array. |
GetAttributeFlagsImpl() |
При переопределении в производном классе реализует свойство Attributes и возвращает побитовое сочетание значений перечисления, указывающих атрибуты, связанные с Type.When overridden in a derived class, implements the Attributes property and gets a bitwise combination of enumeration values that indicate the attributes associated with the Type. |
GetConstructor(BindingFlags, Binder, CallingConventions, Type[], ParameterModifier[]) |
Выполняет поиск конструктора с параметрами, соответствующими указанным модификаторам и типам аргументов, с учетом заданных ограничений по привязке и соглашений о вызовах.Searches for a constructor whose parameters match the specified argument types and modifiers, using the specified binding constraints and the specified calling convention. |
GetConstructor(BindingFlags, Binder, Type[], ParameterModifier[]) |
Выполняет поиск конструктора, параметры которого соответствуют указанным типам аргументов и модификаторам, используя заданные ограничения привязки.Searches for a constructor whose parameters match the specified argument types and modifiers, using the specified binding constraints. |
GetConstructor(Type[]) |
Выполняет поиск открытого конструктора экземпляра, параметры которого соответствуют типам, содержащимся в указанном массиве.Searches for a public instance constructor whose parameters match the types in the specified array. |
GetConstructorImpl(BindingFlags, Binder, CallingConventions, Type[], ParameterModifier[]) |
При переопределении в производном классе ищет конструктор, параметры которого соответствуют указанным типам аргументов и модификаторам, используя для этого заданные ограничения привязки и соглашение о вызовах.When overridden in a derived class, searches for a constructor whose parameters match the specified argument types and modifiers, using the specified binding constraints and the specified calling convention. |
GetConstructors() |
Возвращает все открытые конструкторы, определенные для текущего объекта Type.Returns all the public constructors defined for the current Type. |
GetConstructors(BindingFlags) |
При переопределении в производном классе ищет конструкторы, определенные для текущего объекта Type, с использованием указанного объекта |
GetCustomAttributes(Boolean) |
При переопределении в производном классе возвращает массив всех настраиваемых атрибутов, примененных к данному члену.When overridden in a derived class, returns an array of all custom attributes applied to this member. (Унаследовано от MemberInfo) |
GetCustomAttributes(Type, Boolean) |
При переопределении в производном классе возвращает массив настраиваемых атрибутов, применяемых к этому элементу и определяемых параметром Type.When overridden in a derived class, returns an array of custom attributes applied to this member and identified by Type. (Унаследовано от MemberInfo) |
GetCustomAttributesData() |
Возвращает список объектов CustomAttributeData, представляющих данные об атрибутах, примененных к целевому элементу.Returns a list of CustomAttributeData objects representing data about the attributes that have been applied to the target member. (Унаследовано от MemberInfo) |
GetDefaultMembers() |
Выполняет поиск членов, определенных для текущего объекта Type, для которого задан атрибут DefaultMemberAttribute.Searches for the members defined for the current Type whose DefaultMemberAttribute is set. |
GetElementType() |
При переопределении в производном классе возвращает тип Type объекта, на который ссылается данный массив, указатель или ссылка или который инкапсулирован в этих объектах.When overridden in a derived class, returns the Type of the object encompassed or referred to by the current array, pointer or reference type. |
GetEnumName(Object) |
Возвращает имя константы с заданным значением для текущего типа перечисления.Returns the name of the constant that has the specified value, for the current enumeration type. |
GetEnumNames() |
Возвращает имена членов текущего типа перечисления.Returns the names of the members of the current enumeration type. |
GetEnumUnderlyingType() |
Возвращает базовый тип текущего типа перечисления.Returns the underlying type of the current enumeration type. |
GetEnumValues() |
Возвращает массив значений констант в текущем типе перечисления.Returns an array of the values of the constants in the current enumeration type. |
GetEvent(String) |
Возвращает объект EventInfo, представляющий указанное открытое событие.Returns the EventInfo object representing the specified public event. |
GetEvent(String, BindingFlags) |
При переопределении в производном классе возвращает объект EventInfo, представляющий указанное событие, используя для этого указанные ограничения привязки.When overridden in a derived class, returns the EventInfo object representing the specified event, using the specified binding constraints. |
GetEvents() |
Возвращает все открытые события, которые объявлены или унаследованы текущим объектом Type.Returns all the public events that are declared or inherited by the current Type. |
GetEvents(BindingFlags) |
При переопределении в производном классе ищет события, которые объявлены или унаследованы текущим объектом Type, используя указанные ограничения привязки.When overridden in a derived class, searches for events that are declared or inherited by the current Type, using the specified binding constraints. |
GetField(String) |
Выполняет поиск открытого поля с заданным именем.Searches for the public field with the specified name. |
GetField(String, BindingFlags) |
Выполняет поиск указанного поля, используя заданные ограничения привязки.Searches for the specified field, using the specified binding constraints. |
GetFields() |
Возвращает все открытые поля текущего объекта Type.Returns all the public fields of the current Type. |
GetFields(BindingFlags) |
При переопределении в производном классе ищет поля, определенные для текущего объекта Type, используя указанные ограничения привязки.When overridden in a derived class, searches for the fields defined for the current Type, using the specified binding constraints. |
GetGenericArguments() |
Возвращает массив объектов Type, которые представляют аргументы закрытого универсального типа или параметры определения универсального типа.Returns an array of Type objects that represent the type arguments of a closed generic type or the type parameters of a generic type definition. |
GetGenericParameterConstraints() |
Возвращает массив объектов Type, которые представляют ограничения, накладываемые на параметр текущего универсального типа.Returns an array of Type objects that represent the constraints on the current generic type parameter. |
GetGenericTypeDefinition() |
Возвращает объект Type, представляющий определение универсального типа, на основе которого можно сконструировать текущий универсальный тип.Returns a Type object that represents a generic type definition from which the current generic type can be constructed. |
GetHashCode() |
Возвращает хэш-код данного экземпляра.Returns the hash code for this instance. |
GetInterface(String) |
Выполняет поиск интерфейса с заданным именем.Searches for the interface with the specified name. |
GetInterface(String, Boolean) |
При переопределении в производном классе ищет интерфейс с заданным именем, позволяющий определить, нужно ли выполнять поиск без учета регистра.When overridden in a derived class, searches for the specified interface, specifying whether to do a case-insensitive search for the interface name. |
GetInterfaceMap(Type) |
Возвращает сопоставление для интерфейса заданного типа.Returns an interface mapping for the specified interface type. |
GetInterfaces() |
При переопределении в производном классе возвращает все интерфейсы, реализуемые или наследуемые текущим объектом Type.When overridden in a derived class, gets all the interfaces implemented or inherited by the current Type. |
GetMember(String) |
Выполняет поиск открытого члена с заданным именем.Searches for the public members with the specified name. |
GetMember(String, BindingFlags) |
Выполняет поиск указанных членов, используя заданные ограничения привязки.Searches for the specified members, using the specified binding constraints. |
GetMember(String, MemberTypes, BindingFlags) |
Ищет указанные члены заданного типа, используя установленные ограничения привязки.Searches for the specified members of the specified member type, using the specified binding constraints. |
GetMembers() |
Возвращает все открытые члены текущего объекта Type.Returns all the public members of the current Type. |
GetMembers(BindingFlags) |
При переопределении в производном классе ищет члены, определенные для текущего объекта Type, используя указанные ограничения привязки.When overridden in a derived class, searches for the members defined for the current Type, using the specified binding constraints. |
GetMethod(String) |
Выполняет поиск открытого метода с заданным именем.Searches for the public method with the specified name. |
GetMethod(String, BindingFlags) |
Выполняет поиск указанного метода, используя заданные ограничения привязки.Searches for the specified method, using the specified binding constraints. |
GetMethod(String, BindingFlags, Binder, CallingConventions, Type[], ParameterModifier[]) |
Ищет метод с параметрами, соответствующими указанным модификаторам и типам аргументов, с учетом заданных ограничений привязки и соглашений о вызовах.Searches for the specified method whose parameters match the specified argument types and modifiers, using the specified binding constraints and the specified calling convention. |
GetMethod(String, BindingFlags, Binder, Type[], ParameterModifier[]) |
Ищет заданный метод, параметры которого соответствуют указанным типам аргументов и модификаторам, используя установленные ограничения привязки.Searches for the specified method whose parameters match the specified argument types and modifiers, using the specified binding constraints. |
GetMethod(String, Int32, BindingFlags, Binder, CallingConventions, Type[], ParameterModifier[]) |
Ищет метод с параметрами, соответствующими указанному числу универсальных параметров, модификаторам и типам аргументов, с учетом заданных ограничений привязки и соглашений о вызовах.Searches for the specified method whose parameters match the specified generic parameter count, argument types and modifiers, using the specified binding constraints and the specified calling convention. |
GetMethod(String, Int32, BindingFlags, Binder, Type[], ParameterModifier[]) |
Ищет заданный метод, параметры которого соответствуют указанному числу универсальных параметров, типам аргументов и модификаторам, используя установленные ограничения привязки.Searches for the specified method whose parameters match the specified generic parameter count, argument types and modifiers, using the specified binding constraints. |
GetMethod(String, Int32, Type[]) |
Выполняет поиск указанного открытого метода, параметры которого соответствуют указанному числу универсальных параметров и типам аргументов.Searches for the specified public method whose parameters match the specified generic parameter count and argument types. |
GetMethod(String, Int32, Type[], ParameterModifier[]) |
Выполняет поиск указанного открытого метода, параметры которого соответствуют указанному числу универсальных параметров, типам аргументов и модификаторам.Searches for the specified public method whose parameters match the specified generic parameter count, argument types and modifiers. |
GetMethod(String, Type[]) |
Ищет указанный открытый метод, параметры которого соответствуют заданным типам аргументов.Searches for the specified public method whose parameters match the specified argument types. |
GetMethod(String, Type[], ParameterModifier[]) |
Выполняет поиск указанного открытого метода, параметры которого соответствуют указанным типам аргументов и модификаторам.Searches for the specified public method whose parameters match the specified argument types and modifiers. |
GetMethodImpl(String, BindingFlags, Binder, CallingConventions, Type[], ParameterModifier[]) |
При переопределении в производном классе ищет указанный метод, параметры которого соответствуют указанным типам аргументов и модификаторам, используя для этого заданные ограничения привязки и соглашение о вызовах.When overridden in a derived class, searches for the specified method whose parameters match the specified argument types and modifiers, using the specified binding constraints and the specified calling convention. |
GetMethodImpl(String, Int32, BindingFlags, Binder, CallingConventions, Type[], ParameterModifier[]) |
При переопределении в производном классе ищет указанный метод, параметры которого соответствуют указанному числу универсальных параметров, типам аргументов и модификаторам, используя для этого заданные ограничения привязки и соглашение о вызовах.When overridden in a derived class, searches for the specified method whose parameters match the specified generic parameter count, argument types and modifiers, using the specified binding constraints and the specified calling convention. |
GetMethods() |
Возвращает все открытые методы текущего объекта Type.Returns all the public methods of the current Type. |
GetMethods(BindingFlags) |
При переопределении в производном классе ищет методы, определенные для текущего объекта Type, используя указанные ограничения привязки.When overridden in a derived class, searches for the methods defined for the current Type, using the specified binding constraints. |
GetNestedType(String) |
Выполняет поиск открытого вложенного типа с заданным именем.Searches for the public nested type with the specified name. |
GetNestedType(String, BindingFlags) |
При переопределении в производном классе ищет указанный вложенный тип, используя заданные ограничения привязки.When overridden in a derived class, searches for the specified nested type, using the specified binding constraints. |
GetNestedTypes() |
Возвращает открытые типы, вложенные в текущий объект Type.Returns the public types nested in the current Type. |
GetNestedTypes(BindingFlags) |
При переопределении в производном классе ищет типы, вложенные в текущий объект Type, используя заданные ограничения привязки.When overridden in a derived class, searches for the types nested in the current Type, using the specified binding constraints. |
GetProperties() |
Возвращает все открытые свойства текущего объекта Type.Returns all the public properties of the current Type. |
GetProperties(BindingFlags) |
При переопределении в производном классе ищет свойства текущего объекта Type, используя указанные ограничения привязки.When overridden in a derived class, searches for the properties of the current Type, using the specified binding constraints. |
GetProperty(String) |
Выполняет поиск открытого свойства с заданным именем.Searches for the public property with the specified name. |
GetProperty(String, BindingFlags) |
Ищет указанное свойство, используя заданные ограничения привязки.Searches for the specified property, using the specified binding constraints. |
GetProperty(String, BindingFlags, Binder, Type, Type[], ParameterModifier[]) |
Ищет свойство с параметрами, соответствующими указанным модификаторам и типам аргументов, с учетом заданных ограничений привязки.Searches for the specified property whose parameters match the specified argument types and modifiers, using the specified binding constraints. |
GetProperty(String, Type) |
Выполняет поиск открытого свойства с заданным именем и типом возвращаемого значения.Searches for the public property with the specified name and return type. |
GetProperty(String, Type, Type[]) |
Ищет указанное открытое свойство, параметры которого соответствуют указанным типам аргументов.Searches for the specified public property whose parameters match the specified argument types. |
GetProperty(String, Type, Type[], ParameterModifier[]) |
Ищет заданное открытое свойство, параметры которого соответствуют указанным типам аргументов и модификаторам.Searches for the specified public property whose parameters match the specified argument types and modifiers. |
GetProperty(String, Type[]) |
Ищет указанное открытое свойство, параметры которого соответствуют указанным типам аргументов.Searches for the specified public property whose parameters match the specified argument types. |
GetPropertyImpl(String, BindingFlags, Binder, Type, Type[], ParameterModifier[]) |
При переопределении в производном классе выполняет поиск заданного свойства, параметры которого соответствуют типам и модификаторам заданных аргументов, с использованием заданных ограничений привязки.When overridden in a derived class, searches for the specified property whose parameters match the specified argument types and modifiers, using the specified binding constraints. |
GetType() | |
GetType() |
Возвращает объект Type для текущего экземпляра.Gets the Type of the current instance. (Унаследовано от Object) |
GetType(String) |
Возвращает объект Type с указанным именем, учитывая при поиске регистр.Gets the Type with the specified name, performing a case-sensitive search. |
GetType(String, Boolean) |
Возвращает объект Type с заданным именем, выполняя поиск с учетом регистра и указывая, будет ли создаваться исключение в случае невозможности найти тип.Gets the Type with the specified name, performing a case-sensitive search and specifying whether to throw an exception if the type is not found. |
GetType(String, Boolean, Boolean) |
Возвращает объект Type с указанным именем, позволяющий определить, будет ли создаваться исключение в случае невозможности найти тип и будет ли учитываться регистр при поиске.Gets the Type with the specified name, specifying whether to throw an exception if the type is not found and whether to perform a case-sensitive search. |
GetType(String, Func<AssemblyName,Assembly>, Func<Assembly,String,Boolean,Type>) |
Получает тип с указанным именем; дополнительно может предоставлять настраиваемые методы для разрешения сборки и типа.Gets the type with the specified name, optionally providing custom methods to resolve the assembly and the type. |
GetType(String, Func<AssemblyName,Assembly>, Func<Assembly,String,Boolean,Type>, Boolean) |
Возвращает тип с заданным именем и указывает, следует ли создавать исключение в случае невозможности найти тип, а также может предоставлять настраиваемые методы для разрешения сборки и типа.Gets the type with the specified name, specifying whether to throw an exception if the type is not found, and optionally providing custom methods to resolve the assembly and the type. |
GetType(String, Func<AssemblyName,Assembly>, Func<Assembly,String,Boolean,Type>, Boolean, Boolean) |
Получает тип с заданным именем и указывает, следует ли выполнять поиск без учета регистра и следует ли создавать исключение в случае невозможности найти тип, а также может предоставлять настраиваемые методы для разрешения сборки и типа.Gets the type with the specified name, specifying whether to perform a case-sensitive search and whether to throw an exception if the type is not found, and optionally providing custom methods to resolve the assembly and the type. |
GetTypeArray(Object[]) |
Возвращает типы объектов в указанном массиве.Gets the types of the objects in the specified array. |
GetTypeCode(Type) |
Возвращает код базового типа указанного объекта Type.Gets the underlying type code of the specified Type. |
GetTypeCodeImpl() |
Возвращает код базового типа этого экземпляра Type.Returns the underlying type code of this Type instance. |
GetTypeFromCLSID(Guid) |
Возвращает тип, связанный с заданным кодом CLSID.Gets the type associated with the specified class identifier (CLSID). |
GetTypeFromCLSID(Guid, Boolean) |
Возвращает тип, связанный с заданным кодом CLSID, позволяющий определить, будет ли выбрасываться исключение в случае происхождения ошибки при загрузке типа.Gets the type associated with the specified class identifier (CLSID), specifying whether to throw an exception if an error occurs while loading the type. |
GetTypeFromCLSID(Guid, String) |
Возвращает с указанного сервера тип, связанный с заданным кодом CLSID.Gets the type associated with the specified class identifier (CLSID) from the specified server. |
GetTypeFromCLSID(Guid, String, Boolean) |
Возвращает с указанного сервера тип, связанный с заданным кодом CLSID, позволяющий определить, будет ли выбрасываться исключение при происхождении ошибки во время загрузки типа.Gets the type associated with the specified class identifier (CLSID) from the specified server, specifying whether to throw an exception if an error occurs while loading the type. |
GetTypeFromHandle(RuntimeTypeHandle) |
Возвращает тип, на который ссылается указанный дескриптор типа.Gets the type referenced by the specified type handle. |
GetTypeFromProgID(String) |
Возвращает тип, связанный с указанным идентификатором ProgID, и возвращает значение NULL, если при загрузке объекта Type возникла ошибка.Gets the type associated with the specified program identifier (ProgID), returning null if an error is encountered while loading the Type. |
GetTypeFromProgID(String, Boolean) |
Возвращает тип, связанный с заданным идентификатором ProgID, позволяющим определить, будет ли выбрасываться исключение при происхождении ошибки во время загрузки типа.Gets the type associated with the specified program identifier (ProgID), specifying whether to throw an exception if an error occurs while loading the type. |
GetTypeFromProgID(String, String) |
Возвращает с указанного сервера тип, связанный с заданным идентификатором ProgID, и возвращает значение NULL, если при загрузке типа произошла ошибка.Gets the type associated with the specified program identifier (progID) from the specified server, returning null if an error is encountered while loading the type. |
GetTypeFromProgID(String, String, Boolean) |
Возвращает с указанного сервера тип, связанный с заданным идентификатором progID, который позволяет определить, будет ли выбрасываться исключение при происхождении ошибки во время загрузки типа.Gets the type associated with the specified program identifier (progID) from the specified server, specifying whether to throw an exception if an error occurs while loading the type. |
GetTypeHandle(Object) |
Возвращает дескриптор Type для указанного объекта.Gets the handle for the Type of a specified object. |
HasElementTypeImpl() |
При переопределении в производном классе реализует свойство HasElementType и определяет, что содержится в текущем объекте Type: непосредственно другой тип или же указывающая на него ссылка (иными словами, является ли текущий объект Type массивом, указателем или параметром или же он передается по ссылке).When overridden in a derived class, implements the HasElementType property and determines whether the current Type encompasses or refers to another type; that is, whether the current Type is an array, a pointer, or is passed by reference. |
HasSameMetadataDefinitionAs(MemberInfo) | (Унаследовано от MemberInfo) |
InvokeMember(String, BindingFlags, Binder, Object, Object[]) |
Вызывает указанный член, соответствующий заданным ограничениям привязки и указанному списку аргументов.Invokes the specified member, using the specified binding constraints and matching the specified argument list. |
InvokeMember(String, BindingFlags, Binder, Object, Object[], CultureInfo) |
Вызывает указанный член, соответствующий заданным ограничениям привязки, списку аргументов, а также языку и региональным параметрам.Invokes the specified member, using the specified binding constraints and matching the specified argument list and culture. |
InvokeMember(String, BindingFlags, Binder, Object, Object[], ParameterModifier[], CultureInfo, String[]) |
При переопределении в производном классе вызывает указанный член, соответствующий заданным ограничениям привязки, списку аргументов, модификаторов, а также языку и региональным параметрам.When overridden in a derived class, invokes the specified member, using the specified binding constraints and matching the specified argument list, modifiers and culture. |
IsArrayImpl() |
При переопределении в производном классе реализует свойство IsArray и определяет, является ли данный объект Type массивом.When overridden in a derived class, implements the IsArray property and determines whether the Type is an array. |
IsAssignableFrom(Type) |
Определяет, можно ли присвоить экземпляр указанного типа |
IsAssignableTo(Type) |
Определяет, можно ли назначить текущий тип переменной указанного типа |
IsByRefImpl() |
При переопределении в производном классе реализует свойство IsByRef и определяет, передается ли данный объект Type по ссылке.When overridden in a derived class, implements the IsByRef property and determines whether the Type is passed by reference. |
IsCOMObjectImpl() |
При переопределении в производном классе реализует свойство IsCOMObject и определяет, является ли объект Type COM-объектом.When overridden in a derived class, implements the IsCOMObject property and determines whether the Type is a COM object. |
IsContextfulImpl() |
Реализует свойство IsContextful и определяет, можно ли поместить в контекст данный объект Type.Implements the IsContextful property and determines whether the Type can be hosted in a context. |
IsDefined(Type, Boolean) |
При переопределении в производном классе указывает, применяются ли для этого члена один или несколько атрибутов заданного типа или его производных типов.When overridden in a derived class, indicates whether one or more attributes of the specified type or of its derived types is applied to this member. (Унаследовано от MemberInfo) |
IsEnumDefined(Object) |
Возвращает значение, показывающее, имеется ли в текущем типе перечисления указанное значение.Returns a value that indicates whether the specified value exists in the current enumeration type. |
IsEquivalentTo(Type) |
Определяет, имеют ли два типа модели COM одинаковые удостоверения и могут ли они считаться эквивалентными.Determines whether two COM types have the same identity and are eligible for type equivalence. |
IsInstanceOfType(Object) |
Определяет, является ли указанный объект экземпляром текущего типа Type.Determines whether the specified object is an instance of the current Type. |
IsMarshalByRefImpl() |
Реализует свойство IsMarshalByRef и определяет, маршалируется ли объект Type по ссылке.Implements the IsMarshalByRef property and determines whether the Type is marshaled by reference. |
IsPointerImpl() |
При переопределении в производном классе реализует свойство IsPointer и определяет, является ли объект Type указателем.When overridden in a derived class, implements the IsPointer property and determines whether the Type is a pointer. |
IsPrimitiveImpl() |
При переопределении в производном классе реализует свойство IsPrimitive и определяет, является ли объект Type одним из типов-примитивов.When overridden in a derived class, implements the IsPrimitive property and determines whether the Type is one of the primitive types. |
IsSubclassOf(Type) |
Определяет, является ли текущий Type производным от указанного Type.Determines whether the current Type derives from the specified Type. |
IsValueTypeImpl() |
Реализует свойство IsValueType и определяет, является ли объект Type типом значения (иными словами, не является классом или интерфейсом).Implements the IsValueType property and determines whether the Type is a value type; that is, not a class or an interface. |
MakeArrayType() |
Возвращает объект Type, представляющий одномерный массив текущего типа с нижней границей, равной нулю.Returns a Type object representing a one-dimensional array of the current type, with a lower bound of zero. |
MakeArrayType(Int32) |
Возвращает объект Type, представляющий массив текущего типа указанной размерности.Returns a Type object representing an array of the current type, with the specified number of dimensions. |
MakeByRefType() |
Возвращает объект Type, который представляет текущий тип при передаче в качестве параметра |
MakeGenericMethodParameter(Int32) |
Возвращает объект типа сигнатуры, который может быть передан в параметр массива |
MakeGenericSignatureType(Type, Type[]) |
Создает универсальный тип сигнатуры, позволяющий сторонним реализациям отражения полностью поддерживать использование типов сигнатур в запросах типов.Creates a generic signature type, which allows third party reimplementations of Reflection to fully support the use of signature types in querying type members. |
MakeGenericType(Type[]) |
Замещает элементы массива типов для параметров определения текущего универсального типа и возвращает объект Type, представляющий сконструированный результирующий тип.Substitutes the elements of an array of types for the type parameters of the current generic type definition and returns a Type object representing the resulting constructed type. |
MakePointerType() |
Возвращает объект Type, который представляет указатель на текущий тип.Returns a Type object that represents a pointer to the current type. |
MemberwiseClone() |
Создает неполную копию текущего объекта Object.Creates a shallow copy of the current Object. (Унаследовано от Object) |
ReflectionOnlyGetType(String, Boolean, Boolean) |
Возвращает объект Type с заданным именем, позволяющий определить, будет ли учитываться регистр при поиске, и будет ли создаваться исключение в случае невозможности найти тип.Gets the Type with the specified name, specifying whether to perform a case-sensitive search and whether to throw an exception if the type is not found. Тип загружается не для выполнения, а только для отражения.The type is loaded for reflection only, not for execution. |
ToString() |
Возвращает объект типа |
Операторы
Equality(Type, Type) |
Определение равенства двух объектов Type.Indicates whether two Type objects are equal. |
Inequality(Type, Type) |
Определяет неравенство двух объектов Type.Indicates whether two Type objects are not equal. |
Явные реализации интерфейса
_MemberInfo.GetIDsOfNames(Guid, IntPtr, UInt32, UInt32, IntPtr) |
Сопоставляет набор имен соответствующему набору идентификаторов диспетчеризации.Maps a set of names to a corresponding set of dispatch identifiers. (Унаследовано от MemberInfo) |
_MemberInfo.GetType() |
Возвращает объект Type, представляющий класс MemberInfo.Gets a Type object representing the MemberInfo class. (Унаследовано от MemberInfo) |
_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. (Унаследовано от MemberInfo) |
_MemberInfo.GetTypeInfoCount(UInt32) |
Возвращает количество предоставляемых объектом интерфейсов для доступа к сведениям о типе (0 или 1).Retrieves the number of type information interfaces that an object provides (either 0 or 1). (Унаследовано от MemberInfo) |
_MemberInfo.Invoke(UInt32, Guid, UInt32, Int16, IntPtr, IntPtr, IntPtr, IntPtr) |
Предоставляет доступ к открытым свойствам и методам объекта.Provides access to properties and methods exposed by an object. (Унаследовано от MemberInfo) |
_Type.GetIDsOfNames(Guid, IntPtr, UInt32, UInt32, IntPtr) |
Сопоставляет набор имен соответствующему набору идентификаторов диспетчеризации.Maps a set of names to a corresponding set of dispatch identifiers. |
_Type.GetTypeInfo(UInt32, UInt32, IntPtr) |
Возвращает сведения о типе объекта, которые затем могут использоваться для получения сведений о типе интерфейса.Retrieves the type information for an object, which can then be used to get the type information for an interface. |
_Type.GetTypeInfoCount(UInt32) |
Возвращает количество предоставляемых объектом интерфейсов для доступа к сведениям о типе (0 или 1).Retrieves the number of type information interfaces that an object provides (either 0 or 1). |
_Type.Invoke(UInt32, Guid, UInt32, Int16, IntPtr, IntPtr, IntPtr, IntPtr) |
Предоставляет доступ к открытым свойствам и методам объекта.Provides access to properties and methods exposed by an object. |
ICustomAttributeProvider.GetCustomAttributes(Boolean) |
Возвращает массив всех настраиваемых атрибутов, определенных для этого элемента, за исключением именованных атрибутов, или пустой массив, если атрибуты отсутствуют.Returns an array of all of the custom attributes defined on this member, excluding named attributes, or an empty array if there are no custom attributes. (Унаследовано от MemberInfo) |
ICustomAttributeProvider.GetCustomAttributes(Type, Boolean) |
Возвращает массив настраиваемых атрибутов, определенных для этого элемента с учетом типа, или пустой массив, если отсутствуют настраиваемые атрибуты определенного типа.Returns an array of custom attributes defined on this member, identified by type, or an empty array if there are no custom attributes of that type. (Унаследовано от MemberInfo) |
ICustomAttributeProvider.IsDefined(Type, Boolean) |
Указывает, сколько экземпляров |
Методы расширения
GetCustomAttribute(MemberInfo, Type) |
Извлекает пользовательский атрибут заданного типа, примененный к указанному элементу.Retrieves a custom attribute of a specified type that is applied to a specified member. |
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) |
Извлекает пользовательский атрибут заданного типа, примененный к указанному элементу.Retrieves a custom attribute of a specified type that is applied to a specified member. |
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) |
Извлекает коллекцию настраиваемых атрибутов, примененных к указанному члену.Retrieves a collection of custom attributes that are applied to a specified member. |
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) |
Извлекает коллекцию пользовательских атрибутов заданного типа, примененных к указанному элементу.Retrieves a collection of custom attributes of a specified type that are applied to a specified member. |
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) |
Извлекает коллекцию пользовательских атрибутов заданного типа, примененных к указанному элементу.Retrieves a collection of custom attributes of a specified type that are applied to a specified member. |
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) |
Указывает, применены ли какие-либо пользовательские атрибуты заданного типа к указанному члену.Indicates whether custom attributes of a specified type are applied to a specified member. |
IsDefined(MemberInfo, Type, Boolean) |
Указывает применены ли настраиваемые атрибуты указанного типа к указанному элементу и, при необходимости, применены ли они к его предкам.Indicates whether custom attributes of a specified type are applied to a specified member, and, optionally, applied to its ancestors. |
GetTypeInfo(Type) |
Возвращает представление TypeInfo указанного типа.Returns the TypeInfo representation of the specified type. |
GetMetadataToken(MemberInfo) |
Возвращает маркер метаданных для заданного элемента, если он доступен.Gets a metadata token for the given member, if available. |
HasMetadataToken(MemberInfo) |
Возвращает значение, указывающее, доступен ли маркер метаданных для указанного элемента.Returns a value that indicates whether a metadata token is available for the specified member. |
GetRuntimeEvent(Type, String) |
Получает объект, представляющий указанное событие.Retrieves an object that represents the specified event. |
GetRuntimeEvents(Type) |
Извлекает коллекцию, представляющую все события, определенные в указанном типе.Retrieves a collection that represents all the events defined on a specified type. |
GetRuntimeField(Type, String) |
Извлекает объект , который представляет указанное поле.Retrieves an object that represents a specified field. |
GetRuntimeFields(Type) |
Извлекает коллекцию, представляющую все поля, определенные в указанном типе.Retrieves a collection that represents all the fields defined on a specified type. |
GetRuntimeMethod(Type, String, Type[]) |
Извлекает объект, который представляет указанный метод.Retrieves an object that represents a specified method. |
GetRuntimeMethods(Type) |
Извлекает коллекцию, представляющую все методы, определенные в указанном типе.Retrieves a collection that represents all methods defined on a specified type. |
GetRuntimeProperties(Type) |
Извлекает коллекцию, представляющую все свойства, определенные в указанном типе.Retrieves a collection that represents all the properties defined on a specified type. |
GetRuntimeProperty(Type, String) |
Извлекает объект, который представляет указанное свойство.Retrieves an object that represents a specified property. |
GetConstructor(Type, Type[]) | |
GetConstructors(Type) | |
GetConstructors(Type, BindingFlags) | |
GetDefaultMembers(Type) | |
GetEvent(Type, String) | |
GetEvent(Type, String, BindingFlags) | |
GetEvents(Type) | |
GetEvents(Type, BindingFlags) | |
GetField(Type, String) | |
GetField(Type, String, BindingFlags) | |
GetFields(Type) | |
GetFields(Type, BindingFlags) | |
GetGenericArguments(Type) | |
GetInterfaces(Type) | |
GetMember(Type, String) | |
GetMember(Type, String, BindingFlags) | |
GetMembers(Type) | |
GetMembers(Type, BindingFlags) | |
GetMethod(Type, String) | |
GetMethod(Type, String, BindingFlags) | |
GetMethod(Type, String, Type[]) | |
GetMethods(Type) | |
GetMethods(Type, BindingFlags) | |
GetNestedType(Type, String, BindingFlags) | |
GetNestedTypes(Type, BindingFlags) | |
GetProperties(Type) | |
GetProperties(Type, BindingFlags) | |
GetProperty(Type, String) | |
GetProperty(Type, String, BindingFlags) | |
GetProperty(Type, String, Type) | |
GetProperty(Type, String, Type, Type[]) | |
IsAssignableFrom(Type, Type) | |
IsInstanceOfType(Type, Object) |
Применяется к
Потокобезопасность
Данный тип потокобезопасен.This type is thread safe.