MethodBase Classe
Définition
Fournit des informations sur des méthodes et des constructeurs.Provides information about methods and constructors.
public ref class MethodBase abstract : System::Reflection::MemberInfo, System::Runtime::InteropServices::_MethodBase
[System.Runtime.InteropServices.ClassInterface(System.Runtime.InteropServices.ClassInterfaceType.None)]
[System.Runtime.InteropServices.ComVisible(true)]
[System.Serializable]
public abstract class MethodBase : System.Reflection.MemberInfo, System.Runtime.InteropServices._MethodBase
type MethodBase = class
inherit MemberInfo
interface _MethodBase
Public MustInherit Class MethodBase
Inherits MemberInfo
Implements _MethodBase
- Héritage
- Dérivé
- Attributs
- Implémente
Remarques
MethodBase
est la classe de base MethodInfo de ConstructorInfoet.MethodBase
is the base class of MethodInfo and ConstructorInfo.
Notes pour les responsables de l’implémentation
Lorsque vous héritez MethodBase
de, vous devez substituer les membres suivants GetParameters(): Invoke(Object, BindingFlags, Binder, Object[], CultureInfo), GetMethodImplementationFlags(), MethodHandle, Attributes, Name, DeclaringType, MemberType, ReflectedType, GetCustomAttributes(Boolean) , , GetCustomAttributes(Type, Boolean)et .IsDefined(Type, Boolean)When you inherit from MethodBase
, you must override the following members: GetParameters(), Invoke(Object, BindingFlags, Binder, Object[], CultureInfo), GetMethodImplementationFlags(), MethodHandle, Attributes, Name, DeclaringType, MemberType, ReflectedType, GetCustomAttributes(Boolean), GetCustomAttributes(Type, Boolean), and IsDefined(Type, Boolean).
Constructeurs
MethodBase() |
Initialise une nouvelle instance de la classe MethodBase.Initializes a new instance of the MethodBase class. |
Propriétés
Attributes |
Obtient les attributs associés à cette méthode.Gets the attributes associated with this method. |
CallingConvention |
Obtient une valeur indiquant les conventions d'appel de cette méthode.Gets a value indicating the calling conventions for this method. |
ContainsGenericParameters |
Obtient une valeur indiquant si la méthode générique contient des paramètres de type générique non assignés.Gets a value indicating whether the generic method contains unassigned generic type parameters. |
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) |
DeclaringType |
Obtient la classe qui déclare ce membre.Gets the class that declares this member. (Hérité de MemberInfo) |
IsAbstract |
Obtient une valeur indiquant si la méthode est abstraite.Gets a value indicating whether the method is abstract. |
IsAssembly |
Obtient une valeur indiquant si la visibilité potentielle de cette méthode ou de ce constructeur est décrite par Assembly, c'est-à-dire si la méthode ou le constructeur est visible au maximum par d'autres types du même assembly, et n'est pas visible par des types dérivés à l'extérieur de l'assembly.Gets a value indicating whether the potential visibility of this method or constructor is described by Assembly; that is, the method or constructor is visible at most to other types in the same assembly, and is not visible to derived types outside the assembly. |
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) |
IsConstructedGenericMethod | |
IsConstructor |
Obtient une valeur indiquant si la méthode est un constructeur.Gets a value indicating whether the method is a constructor. |
IsFamily |
Obtient une valeur indiquant si la visibilité de cette méthode ou de ce constructeur est décrite par Family, c'est-à-dire si la méthode ou le constructeur est visible uniquement dans sa classe et dans ses classes dérivées.Gets a value indicating whether the visibility of this method or constructor is described by Family; that is, the method or constructor is visible only within its class and derived classes. |
IsFamilyAndAssembly |
Obtient une valeur indiquant si la visibilité de cette méthode ou de ce constructeur est décrite par FamANDAssem, c'est-à-dire si la méthode ou le constructeur peut être appelé par des classes dérivées, mais uniquement si elles se trouvent dans le même assembly.Gets a value indicating whether the visibility of this method or constructor is described by FamANDAssem; that is, the method or constructor can be called by derived classes, but only if they are in the same assembly. |
IsFamilyOrAssembly |
Obtient une valeur indiquant si la visibilité potentielle de cette méthode ou de ce constructeur est décrite par FamORAssem, c'est-à-dire si la méthode ou le constructeur peut être appelé par des classes dérivées où qu'elles se trouvent, et par des classes du même assembly.Gets a value indicating whether the potential visibility of this method or constructor is described by FamORAssem; that is, the method or constructor can be called by derived classes wherever they are, and by classes in the same assembly. |
IsFinal |
Obtient une valeur indiquant si cette méthode est |
IsGenericMethod |
Obtient une valeur indiquant si la méthode est générique.Gets a value indicating whether the method is generic. |
IsGenericMethodDefinition |
Obtient une valeur indiquant si la méthode est une définition de méthode générique.Gets a value indicating whether the method is a generic method definition. |
IsHideBySig |
Obtient une valeur indiquant si seul un membre du même type, doté d'une signature identique, est caché dans la classe dérivée.Gets a value indicating whether only a member of the same kind with exactly the same signature is hidden in the derived class. |
IsPrivate |
Obtient une valeur indiquant si ce membre est privé.Gets a value indicating whether this member is private. |
IsPublic |
Obtient une valeur indiquant s'il s'agit d'une méthode publique.Gets a value indicating whether this is a public method. |
IsSecurityCritical |
Obtient une valeur qui indique si la méthode ou le constructeur actuel est critique de sécurité (security-critical) ou critique sécurisé (security-safe-critical) au niveau de confiance actuel et peut par conséquent exécuter des opérations critiques.Gets a value that indicates whether the current method or constructor 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 la méthode ou le constructeur actuel est critique sécurisé au niveau de confiance actuel ; autrement dit, si la méthode ou le constructeur peut exécuter des opérations critiques et être accessible par du code transparent.Gets a value that indicates whether the current method or constructor 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 la méthode ou le constructeur actuel est transparent au niveau de confiance actuel et ne peut par conséquent pas exécuter d'opérations critiques.Gets a value that indicates whether the current method or constructor is transparent at the current trust level, and therefore cannot perform critical operations. |
IsSpecialName |
Obtient une valeur indiquant si cette méthode est dotée d'un nom spécial.Gets a value indicating whether this method has a special name. |
IsStatic |
Obtient une valeur indiquant si la méthode est |
IsVirtual |
Obtient une valeur indiquant si la méthode est |
MemberType |
En cas de substitution dans une classe dérivée, récupère une valeur MemberTypes indiquant le type du membre (méthode, constructeur, événement, etc.).When overridden in a derived class, gets a MemberTypes value indicating the type of the member - method, constructor, event, and so on. (Hérité de MemberInfo) |
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) |
MethodHandle |
Obtient un handle vers la représentation interne des métadonnées d'une méthode.Gets a handle to the internal metadata representation of a method. |
MethodImplementationFlags |
Obtient les indicateurs MethodImplAttributes qui spécifient les attributs de l'implémentation d'une méthode.Gets the MethodImplAttributes flags that specify the attributes of a method implementation. |
Module |
Obtient le module dans lequel le type qui déclare le membre représenté par le MemberInfo actuel est défini.Gets the module in which the type that declares the member represented by the current MemberInfo is defined. (Hérité de MemberInfo) |
Name |
Obtient le nom du membre actuel.Gets the name of the current member. (Hérité de MemberInfo) |
ReflectedType |
Obtient l'objet classe utilisé pour obtenir cette instance de |
Méthodes
Equals(Object) |
Retourne une valeur qui indique si cette instance est égale à un objet spécifié.Returns a value that indicates whether this instance is equal to a specified object. |
GetCurrentMethod() |
Retourne un |
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) |
GetGenericArguments() |
Retourne un tableau d'objets Type qui représentent les arguments de type d'une méthode générique ou les paramètres de type d'une définition de méthode générique.Returns an array of Type objects that represent the type arguments of a generic method or the type parameters of a generic method definition. |
GetHashCode() |
Retourne le code de hachage de cette instance.Returns the hash code for this instance. |
GetMethodBody() |
En cas de substitution dans une classe dérivée, obtient un objet MethodBody qui donne accès au flux MSIL, aux variables locales et aux exceptions pour la méthode actuelle.When overridden in a derived class, gets a MethodBody object that provides access to the MSIL stream, local variables, and exceptions for the current method. |
GetMethodFromHandle(RuntimeMethodHandle) |
Obtient des informations sur une méthode en utilisant la représentation interne des métadonnées (handle) de la méthode.Gets method information by using the method's internal metadata representation (handle). |
GetMethodFromHandle(RuntimeMethodHandle, RuntimeTypeHandle) |
Obtient un objet MethodBase pour le constructeur ou la méthode représentés par le handle spécifié, pour le type générique donné.Gets a MethodBase object for the constructor or method represented by the specified handle, for the specified generic type. |
GetMethodImplementationFlags() |
Lors du remplacement dans une classe dérivée, retourne les indicateurs MethodImplAttributes.When overridden in a derived class, returns the MethodImplAttributes flags. |
GetParameters() |
En cas de substitution dans une classe dérivée, obtient les paramètres de la méthode ou du constructeur spécifié.When overridden in a derived class, gets the parameters of the specified method or constructor. |
GetType() | |
HasSameMetadataDefinitionAs(MemberInfo) | (Hérité de MemberInfo) |
Invoke(Object, BindingFlags, Binder, Object[], CultureInfo) |
En cas de substitution dans une classe dérivée, appelle la méthode ou le constructeur réfléchi avec les paramètres donnés.When overridden in a derived class, invokes the reflected method or constructor with the given parameters. |
Invoke(Object, Object[]) |
Appelle la méthode ou le constructeur représenté par l’instance actuelle, selon les paramètres spécifiés.Invokes the method or constructor represented by the current instance, using the specified parameters. |
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) |
MemberwiseClone() |
Crée une copie superficielle du Object actuel.Creates a shallow copy of the current Object. (Hérité de Object) |
ToString() |
Retourne une chaîne qui représente l'objet en cours.Returns a string that represents the current object. (Hérité de Object) |
Opérateurs
Equality(MethodBase, MethodBase) |
Indique si deux objets MethodBase sont égaux.Indicates whether two MethodBase objects are equal. |
Inequality(MethodBase, MethodBase) |
Indique si deux objets MethodBase ne sont pas égaux.Indicates whether two MethodBase 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) |
_MethodBase.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. |
_MethodBase.GetType() |
Pour obtenir une description de ce membre, consultez GetType().For a description of this member, see GetType(). |
_MethodBase.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. |
_MethodBase.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). |
_MethodBase.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. |
_MethodBase.IsAbstract |
Pour obtenir une description de ce membre, consultez IsAbstract.For a description of this member, see IsAbstract. |
_MethodBase.IsAssembly |
Pour obtenir une description de ce membre, consultez IsAssembly.For a description of this member, see IsAssembly. |
_MethodBase.IsConstructor |
Pour obtenir une description de ce membre, consultez IsConstructor.For a description of this member, see IsConstructor. |
_MethodBase.IsFamily |
Pour obtenir une description de ce membre, consultez IsFamily.For a description of this member, see IsFamily. |
_MethodBase.IsFamilyAndAssembly |
Pour obtenir une description de ce membre, consultez IsFamilyAndAssembly.For a description of this member, see IsFamilyAndAssembly. |
_MethodBase.IsFamilyOrAssembly |
Pour obtenir une description de ce membre, consultez IsFamilyOrAssembly.For a description of this member, see IsFamilyOrAssembly. |
_MethodBase.IsFinal |
Pour obtenir une description de ce membre, consultez IsFinal.For a description of this member, see IsFinal. |
_MethodBase.IsHideBySig |
Pour obtenir une description de ce membre, consultez IsHideBySig.For a description of this member, see IsHideBySig. |
_MethodBase.IsPrivate |
Pour obtenir une description de ce membre, consultez IsPrivate.For a description of this member, see IsPrivate. |
_MethodBase.IsPublic |
Pour obtenir une description de ce membre, consultez IsPublic.For a description of this member, see IsPublic. |
_MethodBase.IsSpecialName |
Pour obtenir une description de ce membre, consultez IsSpecialName.For a description of this member, see IsSpecialName. |
_MethodBase.IsStatic |
Pour obtenir une description de ce membre, consultez IsStatic.For a description of this member, see IsStatic. |
_MethodBase.IsVirtual |
Pour obtenir une description de ce membre, consultez IsVirtual.For a description of this member, see IsVirtual. |
ICustomAttributeProvider.GetCustomAttributes(Boolean) | (Hérité de MemberInfo) |
ICustomAttributeProvider.GetCustomAttributes(Type, Boolean) | (Hérité de MemberInfo) |
ICustomAttributeProvider.IsDefined(Type, Boolean) | (Hérité de MemberInfo) |
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. |
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. |
Sécurité
InheritanceDemand
pour une confiance totale pour les héritiers.for full trust for inheritors. Cette classe ne peut pas être héritée par du code de confiance partielle.This class cannot be inherited by partially trusted code.
S’applique à
Cohérence de thread
Ce type est thread-safe.This type is thread safe.