Type Classe
Définition
Représente les déclarations de types : types classe, types interface, types tableau, types valeur, types énumération, paramètres de type, définitions de type générique et types génériques construits ouverts ou fermés.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
- Héritage
-
Type
- Héritage
- Dérivé
- Attributs
- Implémente
Exemples
L’exemple suivant illustre quelques fonctionnalités représentatives de Type .The following example shows a few representative features of Type. L' typeof
opérateur C# ( GetType
opérateur dans Visual Basic) est utilisé pour obtenir un Type objet représentant String .The C# typeof
operator (GetType
operator in Visual Basic) is used to get a Type object representing String. À partir de cet Type objet, la GetMethod méthode est utilisée pour obtenir un MethodInfo représentant la String.Substring surcharge qui prend un emplacement de départ et une longueur.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.
Pour identifier la signature de surcharge, l’exemple de code crée un tableau temporaire contenant deux Type objets représentant int
( Integer
dans Visual Basic).To identify the overload signature, the code example creates a temporary array containing two Type objects representing int
(Integer
in Visual Basic).
Notes
Pour être précis, le tableau contient deux références à l’instance de Type qui représente int
dans le domaine d’application actuel.To be precise, the array contains two references to the instance of Type that represents int
in the current application domain. Pour tout type, il n’existe qu’une seule instance de Type par domaine d’application.For any type, there is only one instance of Type per application domain.
L’exemple de code utilise MethodInfo pour appeler la Substring méthode sur la chaîne « Hello, World ! » et affiche le résultat.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".
Remarques
Type
est la racine de la System.Reflection fonctionnalité et est le principal moyen d’accéder aux métadonnées.Type
is the root of the System.Reflection functionality and is the primary way to access metadata. Utilisez les membres de Type pour obtenir des informations sur une déclaration de type, sur les membres d’un type (tels que les constructeurs, les méthodes, les champs, les propriétés et les événements d’une classe), ainsi que le module et l’assembly dans lequel la classe est déployée.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.
Aucune autorisation n’est requise pour que le code utilise la réflexion pour obtenir des informations sur les types et leurs membres, quel que soit leur niveau d’accès.No permissions are required for code to use reflection to get information about types and their members, regardless of their access levels. Aucune autorisation n’est requise pour que le code utilise la réflexion pour accéder aux membres publics, ou à d’autres membres dont les niveaux d’accès les rend visibles pendant la compilation normale.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. Toutefois, pour que votre code utilise la réflexion pour accéder aux membres normalement inaccessibles, tels que les méthodes privées ou internes, ou aux champs protégés d’un type que votre classe n’hérite pas, votre code doit avoir 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. Consultez considérations relatives à la sécurité pour la réflexion.See Security Considerations for Reflection.
Type
est une classe de base abstraite qui autorise plusieurs implémentations.Type
is an abstract base class that allows multiple implementations. Le système fournira toujours la classe dérivée RuntimeType
.The system will always provide the derived class RuntimeType
. Dans la réflexion, toutes les classes qui commencent par le mot d’exécution sont créées une seule fois par objet dans le système et prennent en charge les opérations de comparaison.In reflection, all classes beginning with the word Runtime are created only once per object in the system and support comparison operations.
Notes
Dans les scénarios de multithreading, ne verrouillez pas les Type objets pour synchroniser l’accès aux static
données.In multithreading scenarios, do not lock Type objects in order to synchronize access to static
data. Tout autre code, sur lequel vous n’avez pas de contrôle, peut également verrouiller votre type de classe.Other code, over which you have no control, might also lock your class type. Cela peut entraîner un interblocage.This might result in a deadlock. Au lieu de cela, synchronisez l’accès aux données statiques en verrouillant un static
objet privé.Instead, synchronize access to static data by locking a private static
object.
Notes
Une classe dérivée peut accéder aux membres protégés des classes de base du code appelant.A derived class can access protected members of the calling code's base classes. En outre, l’accès est autorisé aux membres de l’assembly de l’assembly du code appelant.Also, access is allowed to assembly members of the calling code's assembly. En règle générale, si vous êtes autorisé à accéder à du code à liaison anticipée, vous êtes également autorisé à accéder à du code à liaison tardive.As a rule, if you are allowed access in early-bound code, then you are also allowed access in late-bound code.
Notes
Les interfaces qui étendent d’autres interfaces n’héritent pas des méthodes définies dans les interfaces étendues.Interfaces that extend other interfaces do not inherit the methods defined in the extended interfaces.
Dans cette section :In this section:
Quels types un objet de type représente-t-il ? What types does a Type object represent?
Récupération d’un objet de type Retrieving a Type object
Comparaison d’objets de type pour l’égalitéComparing type objects for equality
Quels types un objet de type représente-t-il ?What types does a Type object represent?
Cette classe est thread-safe ; plusieurs threads peuvent lire simultanément à partir d’une instance de ce type.This class is thread safe; multiple threads can concurrently read from an instance of this type. Une instance de la Type classe peut représenter l’un des types suivants :An instance of the Type class can represent any of the following types:
ClassesClasses
Types de valeurValue types
TableauxArrays
InterfacesInterfaces
ÉnumérationsEnumerations
DéléguésDelegates
Types génériques construits et définitions de type génériqueConstructed generic types and generic type definitions
Arguments de type et paramètres de type des types génériques construits, définitions de types génériques et définitions de méthodes génériquesType arguments and type parameters of constructed generic types, generic type definitions, and generic method definitions
Récupération d’un objet de typeRetrieving a Type object
L' Type objet associé à un type particulier peut être obtenu des manières suivantes :The Type object associated with a particular type can be obtained in the following ways:
La Object.GetType méthode d’instance retourne un Type objet qui représente le type d’une instance.The instance Object.GetType method returns a Type object that represents the type of an instance. Étant donné que tous les types managés dérivent de Object , la GetType méthode peut être appelée sur une instance de n’importe quel type.Because all managed types derive from Object, the GetType method can be called on an instance of any type.
L’exemple suivant appelle la Object.GetType méthode pour déterminer le type au moment de l’exécution de chaque objet dans un tableau d’objets.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
Les méthodes statiques Type.GetType retournent un Type objet qui représente un type spécifié par son nom qualifié complet.The static Type.GetType methods return a Type object that represents a type specified by its fully qualified name.
Les Module.GetTypes Module.GetType méthodes, et Module.FindTypes retournent des
Type
objets qui représentent les types définis dans un module.The Module.GetTypes, Module.GetType, and Module.FindTypes methods returnType
objects that represent the types defined in a module. La première méthode peut être utilisée pour obtenir un tableau d' Type objets pour tous les types publics et privés définis dans un module.The first method can be used to obtain an array of Type objects for all the public and private types defined in a module. (Vous pouvez obtenir une instance deModule
via la Assembly.GetModule Assembly.GetModules méthode ou, ou via la Type.Module propriété.)(You can obtain an instance ofModule
through the Assembly.GetModule or Assembly.GetModules method, or through the Type.Module property.)L' System.Reflection.Assembly objet contient un certain nombre de méthodes pour récupérer les classes définies dans un assembly, notamment Assembly.GetType , Assembly.GetTypes et 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.
La FindInterfaces méthode retourne une liste filtrée de types d’interface pris en charge par un type.The FindInterfaces method returns a filtered list of interface types supported by a type.
La GetElementType méthode retourne un
Type
objet qui représente l’élément.The GetElementType method returns aType
object that represents the element.Les GetInterfaces GetInterface méthodes et retournent des Type objets représentant les types d’interface pris en charge par un type.The GetInterfaces and GetInterface methods return Type objects representing the interface types supported by a type.
La GetTypeArray méthode retourne un tableau d' Type objets représentant les types spécifiés par un jeu d’objets arbitraire.The GetTypeArray method returns an array of Type objects representing the types specified by an arbitrary set of objects. Les objets sont spécifiés avec un tableau de type Object .The objects are specified with an array of type Object.
Les GetTypeFromProgID GetTypeFromCLSID méthodes et sont fournies pour l’interopérabilité COM.The GetTypeFromProgID and GetTypeFromCLSID methods are provided for COM interoperability. Ils retournent un Type objet qui représente le type spécifié par un
ProgID
ou unCLSID
.They return a Type object that represents the type specified by aProgID
orCLSID
.La GetTypeFromHandle méthode est fournie à des fins d’interopérabilité.The GetTypeFromHandle method is provided for interoperability. Elle retourne un
Type
objet qui représente le type spécifié par un handle de classe.It returns aType
object that represents the type specified by a class handle.L’opérateur C#
typeof
, l'typeid
opérateur C++ et l’opérateur Visual BasicGetType
obtiennent l'Type
objet pour un type.The C#typeof
operator, the C++typeid
operator, and the Visual BasicGetType
operator obtain theType
object for a type.La MakeGenericType méthode retourne un Type objet qui représente un type générique construit, qui est un type construit ouvert si sa ContainsGenericParameters propriété retourne
true
, et un type construit fermé dans le cas contraire.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. Un type générique peut être instancié uniquement s’il est fermé.A generic type can be instantiated only if it is closed.Les MakeArrayType MakePointerType méthodes, et MakeByRefType retournent Type des objets qui représentent, respectivement, un tableau d’un type spécifié, un pointeur vers un type spécifié et le type d’un paramètre de référence (
ref
en C#,ByRef
dans 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).
Comparaison d’objets de type pour l’égalitéComparing type objects for equality
Un Type objet qui représente un type est unique ; autrement dit, deux Type références d’objet font référence au même objet si et seulement si elles représentent le même 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. Cela permet de comparer des Type objets à l’aide de l’égalité de référence.This allows for comparison of Type objects using reference equality. L’exemple suivant compare les Type objets qui représentent un nombre de valeurs entières pour déterminer s’ils sont du même 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
Notes pour les responsables de l’implémentation
Lorsque vous héritez de Type
, vous devez substituer les membres suivants : 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[])
Constructeurs
Type() |
Initialise une nouvelle instance de la classe Type.Initializes a new instance of the Type class. |
Champs
Delimiter |
Sépare les noms dans l'espace de noms de Type.Separates names in the namespace of the Type. Ce champ est en lecture seule.This field is read-only. |
EmptyTypes |
Représente un tableau vide du type Type.Represents an empty array of type Type. Ce champ est en lecture seule.This field is read-only. |
FilterAttribute |
Représente le filtre de membres utilisé avec les attributs.Represents the member filter used on attributes. Ce champ est en lecture seule.This field is read-only. |
FilterName |
Représente le filtre de membres, avec respect de la casse, utilisé sur les noms.Represents the case-sensitive member filter used on names. Ce champ est en lecture seule.This field is read-only. |
FilterNameIgnoreCase |
Représente le filtre de membres, sans respect de la casse, utilisé sur les noms.Represents the case-insensitive member filter used on names. Ce champ est en lecture seule.This field is read-only. |
Missing |
Représente une valeur manquante dans les informations Type.Represents a missing value in the Type information. Ce champ est en lecture seule.This field is read-only. |
Propriétés
Assembly |
Obtient le Assembly dans lequel le type est déclaré.Gets the Assembly in which the type is declared. Pour les types génériques, obtient le Assembly dans lequel le type générique est défini.For generic types, gets the Assembly in which the generic type is defined. |
AssemblyQualifiedName |
Obtient le nom qualifié d'assembly du type, y compris le nom de l'assembly à partir duquel l'objet Type a été chargé.Gets the assembly-qualified name of the type, which includes the name of the assembly from which this Type object was loaded. |
Attributes |
Obtient les attributs associés à Type.Gets the attributes associated with the Type. |
BaseType |
Obtient le type dont le Type actuel hérite directement.Gets the type from which the current Type directly inherits. |
ContainsGenericParameters |
Obtient une valeur indiquant si l'objet Type actuel a des paramètres de type qui n'ont pas été remplacés par des types spécifiques.Gets a value indicating whether the current Type object has type parameters that have not been replaced by specific types. |
CustomAttributes |
Obtient une collection qui contient les attributs personnalisés de ce membre.Gets a collection that contains this member's custom attributes. (Hérité de MemberInfo) |
DeclaringMethod |
Obtient un MethodBase représentant la méthode de déclaration, si le Type actuel représente un paramètre de type d’une méthode générique.Gets a MethodBase that represents the declaring method, if the current Type represents a type parameter of a generic method. |
DeclaringType |
Obtient le type qui déclare le type imbriqué ou paramètre de type générique actuel.Gets the type that declares the current nested type or generic type parameter. |
DefaultBinder |
Obtient une référence au binder par défaut, qui implémente les règles internes pour la sélection des membres appropriés appelés par 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 |
Obtient le nom qualifié complet du type, y compris son espace de noms, mais pas l'assembly.Gets the fully qualified name of the type, including its namespace but not its assembly. |
GenericParameterAttributes |
Obtient une combinaison d'indicateurs GenericParameterAttributes qui décrivent la covariance et des contraintes spéciales du paramètre de type générique actuel.Gets a combination of GenericParameterAttributes flags that describe the covariance and special constraints of the current generic type parameter. |
GenericParameterPosition |
Obtient la position du paramètre de type dans la liste des paramètres de type du type générique ou de la méthode qui a déclaré le paramètre, quand l'objet Type représente un paramètre de type d'un type générique ou une méthode générique.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 |
Obtient un tableau des arguments de type générique pour ce type.Gets an array of the generic type arguments for this type. |
GUID |
Obtient le GUID associé à Type.Gets the GUID associated with the Type. |
HasElementType |
Obtient une valeur indiquant si le Type actuel englobe ou se réfère à un autre type, c'est-à-dire si le Type actuel est un tableau ou un pointeur ou encore s'il est passé par référence.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 |
Obtient une valeur indiquant si le Type est abstrait et doit être substitué.Gets a value indicating whether the Type is abstract and must be overridden. |
IsAnsiClass |
Obtient une valeur indiquant si l'attribut de format de chaîne |
IsArray |
Obtient une valeur qui indique si le type est un tableau.Gets a value that indicates whether the type is an array. |
IsAutoClass |
Obtient une valeur indiquant si l'attribut de format de chaîne |
IsAutoLayout |
Obtient une valeur qui indique si les champs du type actuel sont placés automatiquement par le Common Language Runtime.Gets a value indicating whether the fields of the current type are laid out automatically by the common language runtime. |
IsByRef |
Obtient une valeur indiquant si Type est passé par référence.Gets a value indicating whether the Type is passed by reference. |
IsByRefLike |
Obtient une valeur qui indique si le type est une structure de type byref.Gets a value that indicates whether the type is a byref-like structure. |
IsClass |
Obtient une valeur indiquant si le Type est une classe ou un délégué, c'est-à-dire ni un type valeur ni une interface.Gets a value indicating whether the Type is a class or a delegate; that is, not a value type or interface. |
IsCollectible |
Obtient une valeur qui indique si cet objet MemberInfo fait partie d’un assembly contenu dans un AssemblyLoadContext pouvant être collecté.Gets a value that indicates whether this MemberInfo object is part of an assembly held in a collectible AssemblyLoadContext. (Hérité de MemberInfo) |
IsCOMObject |
Obtient une valeur indiquant si Type est un objet COM.Gets a value indicating whether the Type is a COM object. |
IsConstructedGenericType |
Obtient une valeur qui indique si cet objet représente un type générique construit.Gets a value that indicates whether this object represents a constructed generic type. Vous pouvez créer des instances d'un type générique construit.You can create instances of a constructed generic type. |
IsContextful |
Obtient une valeur indiquant si Type peut être hébergé dans un contexte.Gets a value indicating whether the Type can be hosted in a context. |
IsEnum |
Obtient une valeur indiquant si le Type actuel représente une énumération.Gets a value indicating whether the current Type represents an enumeration. |
IsExplicitLayout |
Obtient une valeur qui indique si les champs du type actuel sont placés aux offsets explicitement spécifiés.Gets a value indicating whether the fields of the current type are laid out at explicitly specified offsets. |
IsGenericMethodParameter |
Obtient une valeur indiquant si le Type actuel représente un paramètre de type dans la définition d’une méthode générique.Gets a value that indicates whether the current Type represents a type parameter in the definition of a generic method. |
IsGenericParameter |
Obtient une valeur indiquant si le Type actuel représente un paramètre de type d'une définition de type ou de méthode générique.Gets a value indicating whether the current Type represents a type parameter in the definition of a generic type or method. |
IsGenericType |
Obtient une valeur indiquant si le type actuel est un type générique.Gets a value indicating whether the current type is a generic type. |
IsGenericTypeDefinition |
Obtient une valeur qui indique si le Type actuel représente une définition de type générique, à partir de laquelle d'autres types génériques peuvent être construits.Gets a value indicating whether the current Type represents a generic type definition, from which other generic types can be constructed. |
IsGenericTypeParameter |
Obtient une valeur indiquant si le Type actuel représente un paramètre de type dans la définition d’un type générique.Gets a value that indicates whether the current Type represents a type parameter in the definition of a generic type. |
IsImport |
Obtient une valeur qui indique si le Type a un attribut appliqué ComImportAttribute, indiquant qu'il a été importé d'une bibliothèque de types COM.Gets a value indicating whether the Type has a ComImportAttribute attribute applied, indicating that it was imported from a COM type library. |
IsInterface |
Obtient une valeur indiquant si le Type est une interface, c'est-à-dire ni une classe ni un type valeur.Gets a value indicating whether the Type is an interface; that is, not a class or a value type. |
IsLayoutSequential |
Obtient une valeur qui indique si les champs du type actuel sont placés séquentiellement, en respectant l'ordre dans lequel ils ont été définis ou émis aux métadonnées.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 |
Obtient une valeur indiquant si Type est marshalé par référence.Gets a value indicating whether the Type is marshaled by reference. |
IsNested |
Obtient une valeur indiquant si l'objet Type actuel représente un type dont la définition est imbriquée dans la définition d'un autre type.Gets a value indicating whether the current Type object represents a type whose definition is nested inside the definition of another type. |
IsNestedAssembly |
Obtient une valeur indiquant si le Type est imbriqué et visible uniquement dans son propre assembly.Gets a value indicating whether the Type is nested and visible only within its own assembly. |
IsNestedFamANDAssem |
Obtient une valeur indiquant si le Type est imbriqué et visible uniquement par rapport aux classes qui appartiennent à la fois à sa propre famille et à son propre assembly.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 |
Obtient une valeur indiquant si le Type est imbriqué et visible uniquement dans sa propre famille.Gets a value indicating whether the Type is nested and visible only within its own family. |
IsNestedFamORAssem |
Obtient une valeur indiquant si le Type est imbriqué et visible uniquement par rapport aux classes qui appartiennent à sa propre famille ou à son propre assembly.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 |
Obtient une valeur indiquant si le Type est imbriqué et déclaré privé.Gets a value indicating whether the Type is nested and declared private. |
IsNestedPublic |
Obtient une valeur indiquant si une classe est imbriquée et déclarée publique.Gets a value indicating whether a class is nested and declared public. |
IsNotPublic |
Obtient une valeur indiquant si Type n'est pas déclaré public.Gets a value indicating whether the Type is not declared public. |
IsPointer |
Obtient une valeur indiquant si Type est un pointeur.Gets a value indicating whether the Type is a pointer. |
IsPrimitive |
Obtient une valeur indiquant si le Type est l'un des types primitifs.Gets a value indicating whether the Type is one of the primitive types. |
IsPublic |
Obtient une valeur indiquant si Type est déclaré public.Gets a value indicating whether the Type is declared public. |
IsSealed |
Obtient une valeur indiquant si Type est déclaré sealed.Gets a value indicating whether the Type is declared sealed. |
IsSecurityCritical |
Obtient une valeur qui indique si le type actuel est critique de sécurité (security-critical) ou critique sécurisé (security-safe-critical) au niveau de confiance actuel et peut donc exécuter des opérations critiques.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 |
Obtient une valeur qui indique si le type actuel est critique sécurisé au niveau de confiance actuel, autrement dit s'il peut exécuter des opérations critiques et être accessible par du code transparent.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 |
Obtient une valeur qui indique si le type actuel est transparent au niveau de confiance actuel et ne peut donc pas exécuter d'opérations critiques.Gets a value that indicates whether the current type is transparent at the current trust level, and therefore cannot perform critical operations. |
IsSerializable |
Obtient une valeur indiquant si le Type est sérialisable.Gets a value indicating whether the Type is serializable. |
IsSignatureType |
Obtient une valeur qui indique si le type est un type de signature.Gets a value that indicates whether the type is a signature type. |
IsSpecialName |
Obtient une valeur indiquant si le type a un nom qui nécessite un traitement spécial.Gets a value indicating whether the type has a name that requires special handling. |
IsSZArray |
Obtient une valeur qui indique si le type est un type tableau qui peut représenter uniquement un tableau unidimensionnel avec une limite inférieure à zéro.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 |
Obtient une valeur qui indique si le type est une définition de type.Gets a value that indicates whether the type is a type definition. |
IsUnicodeClass |
Obtient une valeur indiquant si l'attribut de format de chaîne |
IsValueType |
Obtient une valeur indiquant si le Type est un type valeur.Gets a value indicating whether the Type is a value type. |
IsVariableBoundArray |
Obtient une valeur qui indique si le type est un type tableau qui peut représenter uniquement un tableau multidimensionnel ou un tableau avec une limite inférieure arbitraire.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 |
Obtient une valeur qui indique si Type est accessible par code à l'extérieur de l'assembly.Gets a value indicating whether the Type can be accessed by code outside the assembly. |
MemberType |
Obtient une valeur MemberTypes qui indique que ce membre est un type ou un type imbriqué.Gets a MemberTypes value indicating that this member is a type or a nested type. |
MetadataToken |
Obtient une valeur qui identifie un élément de métadonnées.Gets a value that identifies a metadata element. (Hérité de MemberInfo) |
Module |
Obtient le module (la DLL) dans lequel le Type actuel est défini.Gets the module (the DLL) in which the current Type is defined. |
Name |
En cas de substitution dans une classe dérivée, obtient le nom du type actuel.When overridden in a derived class, gets the name of the current type. |
Name |
Obtient le nom du membre actuel.Gets the name of the current member. (Hérité de MemberInfo) |
Namespace |
Obtient l'espace de noms de l'objet Type.Gets the namespace of the Type. |
ReflectedType |
Obtient l'objet de la classe qui a été utilisé pour obtenir ce membre.Gets the class object that was used to obtain this member. |
StructLayoutAttribute |
Obtient un StructLayoutAttribute qui décrit la disposition du type actuel.Gets a StructLayoutAttribute that describes the layout of the current type. |
TypeHandle |
Obtient le handle pour le Type actuel.Gets the handle for the current Type. |
TypeInitializer |
Obtient l'initialiseur du type.Gets the initializer for the type. |
UnderlyingSystemType |
Indique le type fourni par le Common Language Runtime qui représente ce type.Indicates the type provided by the common language runtime that represents this type. |
Méthodes
Equals(Object) |
Détermine si le type de système sous-jacent de l’objet Type actuel est identique au type de système sous-jacent du Object spécifié.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) |
Détermine si le type de système sous-jacent du Type actuel est identique au type de système sous-jacent du Type spécifié.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) |
Retourne un tableau d'objets Type représentant une liste filtrée d'interfaces implémentées ou héritées par le Type actuel.Returns an array of Type objects representing a filtered list of interfaces implemented or inherited by the current Type. |
FindMembers(MemberTypes, BindingFlags, MemberFilter, Object) |
Retourne un tableau filtré d'objets MemberInfo du type du membre spécifié.Returns a filtered array of MemberInfo objects of the specified member type. |
GetArrayRank() |
Obtient le nombre de dimensions dans un tableau.Gets the number of dimensions in an array. |
GetAttributeFlagsImpl() |
En cas de substitution dans une classe dérivée, implémente la propriété Attributes et obtient une combinaison de bits de valeurs d’énumération qui indique les attributs qui sont associés au 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[]) |
Recherche un constructeur dont les paramètres correspondent aux types d’arguments et aux modificateurs spécifiés, en utilisant les contraintes de liaison et la convention d’appel indiquées.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[]) |
Recherche un constructeur dont les paramètres correspondent aux types d’arguments et modificateurs spécifiés, à l’aide des contraintes de liaison spécifiées.Searches for a constructor whose parameters match the specified argument types and modifiers, using the specified binding constraints. |
GetConstructor(Type[]) |
Recherche un constructeur d'instance public dont les paramètres correspondent aux types contenus dans le tableau spécifié.Searches for a public instance constructor whose parameters match the types in the specified array. |
GetConstructorImpl(BindingFlags, Binder, CallingConventions, Type[], ParameterModifier[]) |
En cas de substitution dans une classe dérivée, recherche un constructeur dont les paramètres correspondent aux types d’arguments et modificateurs spécifiés, à l’aide des contraintes de liaison et de la convention d’appel spécifiées.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() |
Retourne tous les constructeurs publics définis pour le Type actuel.Returns all the public constructors defined for the current Type. |
GetConstructors(BindingFlags) |
En cas de substitution dans une classe dérivée, recherche les constructeurs définis pour le Type actuel, à l'aide du |
GetCustomAttributes(Boolean) |
En cas de substitution dans une classe dérivée, retourne un tableau de tous les attributs personnalisés appliqués à ce membre.When overridden in a derived class, returns an array of all custom attributes applied to this member. (Hérité de MemberInfo) |
GetCustomAttributes(Type, Boolean) |
En cas de substitution dans une classe dérivée, retourne un tableau d’attributs personnalisés appliqués à ce membre et identifiés par Type.When overridden in a derived class, returns an array of custom attributes applied to this member and identified by Type. (Hérité de MemberInfo) |
GetCustomAttributesData() |
Renvoie une liste d’objets CustomAttributeData représentant des données sur les attributs qui ont été appliqués au membre cible.Returns a list of CustomAttributeData objects representing data about the attributes that have been applied to the target member. (Hérité de MemberInfo) |
GetDefaultMembers() |
Recherche les membres définis pour le Type actuel dont le DefaultMemberAttribute est défini.Searches for the members defined for the current Type whose DefaultMemberAttribute is set. |
GetElementType() |
En cas de substitution dans une classe dérivée, retourne le Type de l'objet englobé ou de l'objet auquel le tableau, pointeur ou type référence actuel fait référence.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) |
Retourne le nom de la constante qui a la valeur spécifiée, pour le type énumération actuel.Returns the name of the constant that has the specified value, for the current enumeration type. |
GetEnumNames() |
Retourne les noms des membres du type énumération actuel.Returns the names of the members of the current enumeration type. |
GetEnumUnderlyingType() |
Retourne le type sous-jacent du type énumération actuel.Returns the underlying type of the current enumeration type. |
GetEnumValues() |
Retourne un tableau des valeurs des constantes dans le type énumération actuel.Returns an array of the values of the constants in the current enumeration type. |
GetEvent(String) |
Retourne l'objet EventInfo représentant l'événement public spécifié.Returns the EventInfo object representing the specified public event. |
GetEvent(String, BindingFlags) |
En cas de substitution dans une classe dérivée, retourne l'objet EventInfo représentant l'événement spécifié, à l'aide des contraintes de liaison spécifiées.When overridden in a derived class, returns the EventInfo object representing the specified event, using the specified binding constraints. |
GetEvents() |
Retourne tous les événements publics qui sont déclarés ou hérités par le Type actuel.Returns all the public events that are declared or inherited by the current Type. |
GetEvents(BindingFlags) |
En cas de substitution dans une classe dérivée, recherche les événements qui sont déclarés ou hérités par le Type actuel, à l’aide des contraintes de liaison spécifiées.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) |
Recherche le champ public portant le nom spécifié.Searches for the public field with the specified name. |
GetField(String, BindingFlags) |
Recherche le champ spécifié, à l’aide des contraintes de liaison spécifiées.Searches for the specified field, using the specified binding constraints. |
GetFields() |
Retourne tous les champs publics du Type actuel.Returns all the public fields of the current Type. |
GetFields(BindingFlags) |
En cas de substitution dans une classe dérivée, recherche les champs définis pour le Type actuel, à l'aide des contraintes de liaison spécifiées.When overridden in a derived class, searches for the fields defined for the current Type, using the specified binding constraints. |
GetGenericArguments() |
Retourne un tableau d’objets Type qui représentent les arguments de type d’un type générique fermé ou les paramètres de type d’une définition de type générique.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() |
Retourne un tableau d'objets Type qui représentent les contraintes qui s'exercent sur le paramètre de type générique actuel.Returns an array of Type objects that represent the constraints on the current generic type parameter. |
GetGenericTypeDefinition() |
Retourne un objet Type qui représente une définition de type générique à partir de laquelle le type générique actuel peut être construit.Returns a Type object that represents a generic type definition from which the current generic type can be constructed. |
GetHashCode() |
Retourne le code de hachage de cette instance.Returns the hash code for this instance. |
GetInterface(String) |
Recherche l'interface avec le nom spécifié.Searches for the interface with the specified name. |
GetInterface(String, Boolean) |
En cas de substitution dans une classe dérivée, recherche l'interface spécifiée, en indiquant s'il faut faire une recherche qui ne respecte pas la casse pour le nom de l'interface.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) |
Retourne un mappage d'interface pour le type interface spécifié.Returns an interface mapping for the specified interface type. |
GetInterfaces() |
En cas de substitution dans une classe dérivée, obtient toutes les interfaces implémentées ou héritées par le Type actuel.When overridden in a derived class, gets all the interfaces implemented or inherited by the current Type. |
GetMember(String) |
Recherche les membres publics portant le nom spécifié.Searches for the public members with the specified name. |
GetMember(String, BindingFlags) |
Recherche les membres spécifiés, à l'aide des contraintes de liaison spécifiées.Searches for the specified members, using the specified binding constraints. |
GetMember(String, MemberTypes, BindingFlags) |
Recherche les membres spécifiés du type de membre spécifié, à l’aide des contraintes de liaison spécifiées.Searches for the specified members of the specified member type, using the specified binding constraints. |
GetMembers() |
Retourne tous les membres publics du Type actuel.Returns all the public members of the current Type. |
GetMembers(BindingFlags) |
En cas de substitution dans une classe dérivée, recherche les membres définis pour le Type actuel, à l’aide des contraintes de liaison spécifiées.When overridden in a derived class, searches for the members defined for the current Type, using the specified binding constraints. |
GetMethod(String) |
Recherche la méthode publique avec le nom spécifié.Searches for the public method with the specified name. |
GetMethod(String, BindingFlags) |
Recherche la méthode spécifiée, à l'aide des contraintes de liaison spécifiées.Searches for the specified method, using the specified binding constraints. |
GetMethod(String, BindingFlags, Binder, CallingConventions, Type[], ParameterModifier[]) |
Recherche la méthode spécifiée dont les paramètres correspondent aux types d'arguments et aux modificateurs spécifiés, en utilisant les contraintes de liaison et la convention d'appel indiquées.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[]) |
Recherche la méthode spécifiée dont les paramètres correspondent aux types d'arguments et modificateurs spécifiés, à l'aide des contraintes de liaison spécifiées.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[]) |
Recherche la méthode spécifiée dont les paramètres correspondent au nombre de paramètres génériques, aux types d'arguments et aux modificateurs spécifiés, en utilisant les contraintes de liaison et la convention d'appel indiquées.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[]) |
Recherche la méthode spécifiée dont les paramètres correspondent au nombre de paramètres génériques, aux types d'arguments et aux modificateurs spécifiés, à l'aide des contraintes de liaison spécifiées.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[]) |
Recherche la méthode publique spécifiée dont les paramètres correspondent au nombre d’arguments génériques et aux types d’arguments spécifiés.Searches for the specified public method whose parameters match the specified generic parameter count and argument types. |
GetMethod(String, Int32, Type[], ParameterModifier[]) |
Recherche la méthode publique spécifiée dont les paramètres correspondent au nombre d’arguments génériques, aux modificateurs et aux types d’arguments spécifiés.Searches for the specified public method whose parameters match the specified generic parameter count, argument types and modifiers. |
GetMethod(String, Type[]) |
Recherche la méthode publique spécifiée dont les paramètres correspondent aux types d'arguments spécifiés.Searches for the specified public method whose parameters match the specified argument types. |
GetMethod(String, Type[], ParameterModifier[]) |
Recherche la méthode publique spécifiée dont les paramètres correspondent aux types d’arguments et modificateurs spécifiés.Searches for the specified public method whose parameters match the specified argument types and modifiers. |
GetMethodImpl(String, BindingFlags, Binder, CallingConventions, Type[], ParameterModifier[]) |
En cas de substitution dans une classe dérivée, recherche la méthode spécifiée dont les paramètres correspondent aux types d'arguments et modificateurs spécifiés, à l'aide des contraintes de liaison et de la convention d'appel spécifiées.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[]) |
En cas de substitution dans une classe dérivée, recherche la méthode spécifiée dont les paramètres correspondent au nombre de paramètres, aux types d'arguments et aux modificateurs spécifiés, à l'aide des contraintes de liaison et de la convention d'appel spécifiées.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() |
Retourne toutes les méthodes publiques du Type actuel.Returns all the public methods of the current Type. |
GetMethods(BindingFlags) |
En cas de substitution dans une classe dérivée, recherche les méthodes définies pour le Type actuel, à l'aide des contraintes de liaison spécifiées.When overridden in a derived class, searches for the methods defined for the current Type, using the specified binding constraints. |
GetNestedType(String) |
Recherche le type imbriqué public avec le nom spécifié.Searches for the public nested type with the specified name. |
GetNestedType(String, BindingFlags) |
En cas de substitution dans une classe dérivée, recherche le type imbriqué spécifié, à l'aide des contraintes de liaison spécifiées.When overridden in a derived class, searches for the specified nested type, using the specified binding constraints. |
GetNestedTypes() |
Retourne les types publics imbriqués dans le Type actuel.Returns the public types nested in the current Type. |
GetNestedTypes(BindingFlags) |
En cas de substitution dans une classe dérivée, recherche les types imbriqués dans le Type actuel, à l'aide des contraintes de liaison spécifiées.When overridden in a derived class, searches for the types nested in the current Type, using the specified binding constraints. |
GetProperties() |
Retourne toutes les propriétés publiques du Type actuel.Returns all the public properties of the current Type. |
GetProperties(BindingFlags) |
En cas de substitution dans une classe dérivée, recherche les propriétés du Type actuel, à l’aide des contraintes de liaison spécifiées.When overridden in a derived class, searches for the properties of the current Type, using the specified binding constraints. |
GetProperty(String) |
Recherche la propriété publique avec le nom spécifié.Searches for the public property with the specified name. |
GetProperty(String, BindingFlags) |
Recherche la propriété spécifiée, à l'aide des contraintes de liaison spécifiées.Searches for the specified property, using the specified binding constraints. |
GetProperty(String, BindingFlags, Binder, Type, Type[], ParameterModifier[]) |
Recherche la propriété spécifiée dont les paramètres correspondent aux types d’arguments et aux modificateurs spécifiés, en utilisant les contraintes de liaison indiquées.Searches for the specified property whose parameters match the specified argument types and modifiers, using the specified binding constraints. |
GetProperty(String, Type) |
Recherche la propriété publique à l'aide du nom et du type de retour spécifiés.Searches for the public property with the specified name and return type. |
GetProperty(String, Type, Type[]) |
Recherche la propriété publique spécifiée dont les paramètres correspondent aux types d’arguments spécifiés.Searches for the specified public property whose parameters match the specified argument types. |
GetProperty(String, Type, Type[], ParameterModifier[]) |
Recherche la propriété publique spécifiée dont les paramètres correspondent aux types d'arguments et modificateurs spécifiés.Searches for the specified public property whose parameters match the specified argument types and modifiers. |
GetProperty(String, Type[]) |
Recherche la propriété publique spécifiée dont les paramètres correspondent aux types d’arguments spécifiés.Searches for the specified public property whose parameters match the specified argument types. |
GetPropertyImpl(String, BindingFlags, Binder, Type, Type[], ParameterModifier[]) |
En cas de substitution dans une classe dérivée, recherche la propriété spécifiée dont les paramètres correspondent aux types d'arguments et modificateurs spécifiés, en utilisant les contraintes de liaison indiquées.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() |
Obtient le Type de l'instance actuelle.Gets the Type of the current instance. (Hérité de Object) |
GetType(String) |
Obtient le Type avec le nom spécifié, effectuant une recherche qui respecte la casse.Gets the Type with the specified name, performing a case-sensitive search. |
GetType(String, Boolean) |
Obtient le Type portant le nom spécifié, en effectuant une recherche respectant la casse et en spécifiant s'il faut lever une exception si le type est introuvable.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) |
Obtient le Type portant le nom spécifié, indiquant s'il faut lever une exception si le type est introuvable et s'il faut effectuer une recherche respectant la casse.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>) |
Obtient le type avec le nom spécifié et éventuellement des méthodes personnalisées permettant de résoudre l'assembly et le 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) |
Obtient le type portant le nom spécifié, en indiquant s'il faut lever une exception si le type est introuvable et, éventuellement, en fournissant des méthodes personnalisées qui permettent de résoudre l'assembly et le type.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) |
Obtient le type portant le nom spécifié, en indiquant s'il faut effectuer une recherche qui respecte la casse et si une exception doit être levée si le type est introuvable, et éventuellement, en fournissant des méthodes personnalisées qui permettent de résoudre l'assembly et le 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, and optionally providing custom methods to resolve the assembly and the type. |
GetTypeArray(Object[]) |
Obtient les types des objets dans le tableau spécifié.Gets the types of the objects in the specified array. |
GetTypeCode(Type) |
Obtient le code du type sous-jacent du Type spécifié.Gets the underlying type code of the specified Type. |
GetTypeCodeImpl() |
Retourne le code du type sous-jacent de cette instance Type.Returns the underlying type code of this Type instance. |
GetTypeFromCLSID(Guid) |
Obtient le type associé à l'identificateur de classe (CLSID) spécifié.Gets the type associated with the specified class identifier (CLSID). |
GetTypeFromCLSID(Guid, Boolean) |
Obtient le type associé à l'identificateur de classe (CLSID) spécifié, indiquant s'il faut lever une exception en cas d'erreur pendant le chargement du type.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) |
Obtient le type associé à l'identificateur de classe (CLSID) spécifié à partir du serveur défini.Gets the type associated with the specified class identifier (CLSID) from the specified server. |
GetTypeFromCLSID(Guid, String, Boolean) |
Obtient le type associé à l'identificateur de classe (CLSID) spécifié à partir du serveur défini, indiquant s'il faut lever une exception en cas d'erreur pendant le chargement du type.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) |
Obtient le type référencé par le handle de type spécifié.Gets the type referenced by the specified type handle. |
GetTypeFromProgID(String) |
Obtient le type associé à l'identificateur de programme (ProgID) spécifié, retournant null en cas d'erreur pendant le chargement de 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) |
Obtient le type associé à l'identificateur de programme (ProgID) spécifié, indiquant s'il faut lever une exception en cas d'erreur pendant le chargement du type.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) |
Obtient le type associé à l'identificateur de programme (ProgID) spécifié à partir du serveur défini, retournant null en cas d'erreur pendant le chargement du type.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) |
Obtient le type associé à l'identificateur de programme (ProgID) spécifié à partir du serveur défini, indiquant s'il faut lever une exception en cas d'erreur pendant le chargement du type.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) |
Obtient le handle pour le Type d'un objet spécifié.Gets the handle for the Type of a specified object. |
HasElementTypeImpl() |
En cas de substitution dans une classe dérivée, implémente la propriété HasElementType et détermine si le Type actuel englobe ou se réfère à un autre type ; c'est-à-dire si le Type actuel est un tableau ou un pointeur ou encore s'il est passé par référence.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) | (Hérité de MemberInfo) |
InvokeMember(String, BindingFlags, Binder, Object, Object[]) |
Appelle le membre défini, à l'aide des contraintes de liaison spécifiées et correspondant à la liste d'arguments spécifiée.Invokes the specified member, using the specified binding constraints and matching the specified argument list. |
InvokeMember(String, BindingFlags, Binder, Object, Object[], CultureInfo) |
Appelle le membre spécifié, à l'aide des contraintes de liaison spécifiées et correspondant à la liste d'arguments et à la culture spécifiées.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[]) |
En cas de substitution dans une classe dérivée, appelle le membre défini, à l'aide des contraintes de liaison spécifiées et correspondant à la liste d'arguments, aux modificateurs et à la culture spécifiés.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() |
En cas de substitution dans une classe dérivée, implémente la propriété IsArray et détermine si Type est un tableau.When overridden in a derived class, implements the IsArray property and determines whether the Type is an array. |
IsAssignableFrom(Type) |
Détermine si une instance d’un type spécifié |
IsAssignableTo(Type) |
Détermine si un type actuel peut être affecté à une variable du type |
IsByRefImpl() |
En cas de substitution dans une classe dérivée, implémente la propriété IsByRef et détermine si le Type est passé par référence.When overridden in a derived class, implements the IsByRef property and determines whether the Type is passed by reference. |
IsCOMObjectImpl() |
En cas de substitution dans une classe dérivée, implémente la propriété IsCOMObject et détermine si le Type est un objet COM.When overridden in a derived class, implements the IsCOMObject property and determines whether the Type is a COM object. |
IsContextfulImpl() |
Implémente la propriété IsContextful et détermine si Type peut être hébergé dans un contexte.Implements the IsContextful property and determines whether the Type can be hosted in a context. |
IsDefined(Type, Boolean) |
En cas de substitution dans une classe dérivée, indique si un ou plusieurs attributs du type spécifié ou de ses types dérivés sont appliqués à ce membre.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. (Hérité de MemberInfo) |
IsEnumDefined(Object) |
Retourne une valeur qui indique si la valeur spécifiée existe dans le type énumération actuel.Returns a value that indicates whether the specified value exists in the current enumeration type. |
IsEquivalentTo(Type) |
Détermine si deux types COM ont la même identité et prennent en charge l'équivalence de type.Determines whether two COM types have the same identity and are eligible for type equivalence. |
IsInstanceOfType(Object) |
Détermine si l'objet spécifié est une instance du Type actuel.Determines whether the specified object is an instance of the current Type. |
IsMarshalByRefImpl() |
Implémente la propriété IsMarshalByRef et détermine si le Type est marshalé par référence.Implements the IsMarshalByRef property and determines whether the Type is marshaled by reference. |
IsPointerImpl() |
En cas de substitution dans une classe dérivée, implémente la propriété IsPointer et détermine si le Type est un pointeur.When overridden in a derived class, implements the IsPointer property and determines whether the Type is a pointer. |
IsPrimitiveImpl() |
En cas de substitution dans une classe dérivée, implémente la propriété IsPrimitive et détermine si Type est l'un des types primitifs.When overridden in a derived class, implements the IsPrimitive property and determines whether the Type is one of the primitive types. |
IsSubclassOf(Type) |
Détermine si le Type actuel dérive du Type spécifié.Determines whether the current Type derives from the specified Type. |
IsValueTypeImpl() |
Implémente la propriété IsValueType et détermine si le Type est un type valeur, c'est-à-dire ni une classe ni une interface.Implements the IsValueType property and determines whether the Type is a value type; that is, not a class or an interface. |
MakeArrayType() |
Retourne un objet Type qui représente un tableau unidimensionnel du type actuel, avec une limite inférieure de zéro.Returns a Type object representing a one-dimensional array of the current type, with a lower bound of zero. |
MakeArrayType(Int32) |
Retourne un objet Type qui représente un tableau du type actuel, avec le nombre spécifié de dimensions.Returns a Type object representing an array of the current type, with the specified number of dimensions. |
MakeByRefType() |
Retourne un objet Type qui représente le type actuel quand il est passé en tant que paramètre |
MakeGenericMethodParameter(Int32) |
Retourne un objet de type signature qui peut être passé dans le paramètre de tableau |
MakeGenericSignatureType(Type, Type[]) |
Crée un type de signature générique, qui permet aux réimplémentations tierces de réflexion de prendre entièrement en charge l’utilisation des types de signature dans l’interrogation des membres de 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[]) |
Substitue les éléments d'un tableau de types aux paramètres de type de la définition du type générique actuel et retourne un objet Type qui représente le type construit résultant.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() |
Retourne un objet Type qui représente un pointeur vers le type actuel.Returns a Type object that represents a pointer to the current type. |
MemberwiseClone() |
Crée une copie superficielle du Object actuel.Creates a shallow copy of the current Object. (Hérité de Object) |
ReflectionOnlyGetType(String, Boolean, Boolean) |
Obtient le Type portant le nom spécifié, indiquant s'il faut effectuer une recherche respectant la casse et lever une exception si le type est introuvable.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. Le type est chargé dans un contexte de réflexion, et non d'exécution.The type is loaded for reflection only, not for execution. |
ToString() |
Retourne |
Opérateurs
Equality(Type, Type) |
Indique si deux objets Type sont égaux.Indicates whether two Type objects are equal. |
Inequality(Type, Type) |
Indique si deux objets Type ne sont pas égaux.Indicates whether two Type objects are not equal. |
Implémentations d’interfaces explicites
_MemberInfo.GetIDsOfNames(Guid, IntPtr, UInt32, UInt32, IntPtr) |
Mappe un jeu de noms avec un jeu correspondant d'identificateurs de dispatch.Maps a set of names to a corresponding set of dispatch identifiers. (Hérité de MemberInfo) |
_MemberInfo.GetType() |
Obtient un objet Type représentant la classe MemberInfo.Gets a Type object representing the MemberInfo class. (Hérité de MemberInfo) |
_MemberInfo.GetTypeInfo(UInt32, UInt32, IntPtr) |
Récupère les informations de type pour un objet, qui peuvent être utilisées ensuite pour obtenir les informations de type d'une interface.Retrieves the type information for an object, which can then be used to get the type information for an interface. (Hérité de MemberInfo) |
_MemberInfo.GetTypeInfoCount(UInt32) |
Récupère le nombre d'interfaces d'informations de type fourni par un objet (0 ou 1).Retrieves the number of type information interfaces that an object provides (either 0 or 1). (Hérité de MemberInfo) |
_MemberInfo.Invoke(UInt32, Guid, UInt32, Int16, IntPtr, IntPtr, IntPtr, IntPtr) |
Fournit l'accès aux propriétés et aux méthodes exposées par un objet.Provides access to properties and methods exposed by an object. (Hérité de MemberInfo) |
_Type.GetIDsOfNames(Guid, IntPtr, UInt32, UInt32, IntPtr) |
Mappe un jeu de noms avec un jeu correspondant d'identificateurs de dispatch.Maps a set of names to a corresponding set of dispatch identifiers. |
_Type.GetTypeInfo(UInt32, UInt32, IntPtr) |
Récupère les informations de type pour un objet, qui peuvent être utilisées ensuite pour obtenir les informations de type d'une interface.Retrieves the type information for an object, which can then be used to get the type information for an interface. |
_Type.GetTypeInfoCount(UInt32) |
Récupère le nombre d'interfaces d'informations de type fourni par un objet (0 ou 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) |
Fournit l'accès aux propriétés et aux méthodes exposées par un objet.Provides access to properties and methods exposed by an object. |
ICustomAttributeProvider.GetCustomAttributes(Boolean) |
Retourne un tableau de tous les attributs personnalisés définis sur ce membre, en dehors des attributs nommés, ou un tableau vide s’il n’y a aucun attribut personnalisé.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. (Hérité de MemberInfo) |
ICustomAttributeProvider.GetCustomAttributes(Type, Boolean) |
Retourne un tableau d’attributs personnalisés définis sur ce membre, identifiés par type, ou un tableau vide s’il n’y a aucun attribut personnalisé de ce type.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. (Hérité de MemberInfo) |
ICustomAttributeProvider.IsDefined(Type, Boolean) |
Indique si une ou plusieurs instances de |
Méthodes d’extension
GetCustomAttribute(MemberInfo, Type) |
Récupère un attribut personnalisé d'un type spécifié qui est appliqué à un membre spécifié.Retrieves a custom attribute of a specified type that is applied to a specified member. |
GetCustomAttribute(MemberInfo, Type, Boolean) |
Récupère un attribut personnalisé d'un type spécifié qui est appliqué à un membre spécifié, et inspecte éventuellement les ancêtres de ce membre.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) |
Récupère un attribut personnalisé d'un type spécifié qui est appliqué à un membre spécifié.Retrieves a custom attribute of a specified type that is applied to a specified member. |
GetCustomAttribute<T>(MemberInfo, Boolean) |
Récupère un attribut personnalisé d'un type spécifié qui est appliqué à un membre spécifié, et inspecte éventuellement les ancêtres de ce membre.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) |
Récupère une collection d'attributs personnalisés qui sont appliqués à un membre spécifié.Retrieves a collection of custom attributes that are applied to a specified member. |
GetCustomAttributes(MemberInfo, Boolean) |
Récupère une collection d'attributs personnalisés qui sont appliqués à un membre spécifié, et inspecte éventuellement les ancêtres de ce membre.Retrieves a collection of custom attributes that are applied to a specified member, and optionally inspects the ancestors of that member. |
GetCustomAttributes(MemberInfo, Type) |
Extrait une collection d'attributs personnalisés d'un type spécifié qui sont appliqués à un membre spécifié.Retrieves a collection of custom attributes of a specified type that are applied to a specified member. |
GetCustomAttributes(MemberInfo, Type, Boolean) |
Extrait une collection d'attributs personnalisés d'un type spécifié qui sont appliqués à un membre spécifié, et inspecte éventuellement les ancêtres de ce membre.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) |
Extrait une collection d'attributs personnalisés d'un type spécifié qui sont appliqués à un membre spécifié.Retrieves a collection of custom attributes of a specified type that are applied to a specified member. |
GetCustomAttributes<T>(MemberInfo, Boolean) |
Extrait une collection d'attributs personnalisés d'un type spécifié qui sont appliqués à un membre spécifié, et inspecte éventuellement les ancêtres de ce membre.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) |
Indique si des attributs personnalisés d'un type spécifié sont appliqués à un membre spécifié.Indicates whether custom attributes of a specified type are applied to a specified member. |
IsDefined(MemberInfo, Type, Boolean) |
Indique si les attributs personnalisés d'un type spécifié sont appliqués à un membre spécifié, et, éventuellement, appliqués à ses ancêtres.Indicates whether custom attributes of a specified type are applied to a specified member, and, optionally, applied to its ancestors. |
GetTypeInfo(Type) |
Retourne la représentation TypeInfo du type spécifié.Returns the TypeInfo representation of the specified type. |
GetMetadataToken(MemberInfo) |
Obtient un jeton de métadonnées pour le membre donné, s’il est disponible.Gets a metadata token for the given member, if available. |
HasMetadataToken(MemberInfo) |
Retourne une valeur qui indique si un jeton de métadonnées est disponible pour le membre spécifié.Returns a value that indicates whether a metadata token is available for the specified member. |
GetRuntimeEvent(Type, String) |
Récupère un objet qui représente l’événement spécifié.Retrieves an object that represents the specified event. |
GetRuntimeEvents(Type) |
Récupère une collection qui représente tous les événements définis sur un type spécifié.Retrieves a collection that represents all the events defined on a specified type. |
GetRuntimeField(Type, String) |
Récupère un objet qui représente un champ spécifié.Retrieves an object that represents a specified field. |
GetRuntimeFields(Type) |
Récupère une collection qui représente tous les événements définis sur un type spécifié.Retrieves a collection that represents all the fields defined on a specified type. |
GetRuntimeMethod(Type, String, Type[]) |
Récupère un objet qui représente une méthode spécifiée.Retrieves an object that represents a specified method. |
GetRuntimeMethods(Type) |
Récupère une collection qui représente toutes les méthodes définies sur un type spécifié.Retrieves a collection that represents all methods defined on a specified type. |
GetRuntimeProperties(Type) |
Récupère une collection qui représente toutes les méthodes définies sur un type spécifié.Retrieves a collection that represents all the properties defined on a specified type. |
GetRuntimeProperty(Type, String) |
Récupère un objet qui représente une propriété spécifiée.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) |
S’applique à
Cohérence de thread
Ce type est thread-safe.This type is thread safe.