MethodBase Clase
Definición
Proporciona información sobre los métodos y los constructores.Provides information about methods and constructors.
public ref class MethodBase abstract : System::Reflection::MemberInfo
public ref class MethodBase abstract : System::Reflection::MemberInfo, System::Runtime::InteropServices::_MethodBase
public abstract class MethodBase : System.Reflection.MemberInfo
[System.Runtime.InteropServices.ClassInterface(System.Runtime.InteropServices.ClassInterfaceType.None)]
[System.Serializable]
public abstract class MethodBase : System.Reflection.MemberInfo, System.Runtime.InteropServices._MethodBase
[System.Runtime.InteropServices.ClassInterface(System.Runtime.InteropServices.ClassInterfaceType.None)]
[System.Serializable]
[System.Runtime.InteropServices.ComVisible(true)]
public abstract class MethodBase : System.Reflection.MemberInfo, System.Runtime.InteropServices._MethodBase
type MethodBase = class
inherit MemberInfo
[<System.Runtime.InteropServices.ClassInterface(System.Runtime.InteropServices.ClassInterfaceType.None)>]
[<System.Serializable>]
type MethodBase = class
inherit MemberInfo
interface _MethodBase
[<System.Runtime.InteropServices.ClassInterface(System.Runtime.InteropServices.ClassInterfaceType.None)>]
[<System.Serializable>]
[<System.Runtime.InteropServices.ComVisible(true)>]
type MethodBase = class
inherit MemberInfo
interface _MethodBase
Public MustInherit Class MethodBase
Inherits MemberInfo
Public MustInherit Class MethodBase
Inherits MemberInfo
Implements _MethodBase
- Herencia
- Derivado
- Atributos
- Implementaciones
Comentarios
MethodBase
es la clase base de MethodInfo y ConstructorInfo .MethodBase
is the base class of MethodInfo and ConstructorInfo.
Notas a los implementadores
Al heredar de MethodBase
, debe reemplazar los miembros siguientes: GetParameters() , Invoke(Object, BindingFlags, Binder, Object[], CultureInfo) , GetMethodImplementationFlags() , MethodHandle , Attributes , Name ,,, DeclaringType MemberType ReflectedType , GetCustomAttributes(Boolean) , GetCustomAttributes(Type, Boolean) y 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).
Constructores
MethodBase() |
Inicializa una nueva instancia de la clase MethodBase.Initializes a new instance of the MethodBase class. |
Propiedades
Attributes |
Obtiene los atributos asociados a este método.Gets the attributes associated with this method. |
CallingConvention |
Obtiene un valor que indica las convenciones de llamada de este método.Gets a value indicating the calling conventions for this method. |
ContainsGenericParameters |
Obtiene un valor que indica si el método genérico contiene parámetros de tipo genérico sin asignar.Gets a value indicating whether the generic method contains unassigned generic type parameters. |
CustomAttributes |
Obtiene una colección que contiene los atributos personalizados de este miembro.Gets a collection that contains this member's custom attributes. (Heredado de MemberInfo) |
DeclaringType |
Obtiene la clase que declara este miembro.Gets the class that declares this member. (Heredado de MemberInfo) |
IsAbstract |
Obtiene un valor que indica si el método es abstracto.Gets a value indicating whether the method is abstract. |
IsAssembly |
Obtiene un valor que indica si Assembly describe la visibilidad posible de este método o constructor; es decir, el método o el constructor es visible como mucho para otros tipos del mismo ensamblado y no es visible para los tipos derivados fuera del ensamblado.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 |
Obtiene un valor que indica si este objeto MemberInfo forma parte de un ensamblado contenido en un AssemblyLoadContext recopilable.Gets a value that indicates whether this MemberInfo object is part of an assembly held in a collectible AssemblyLoadContext. (Heredado de MemberInfo) |
IsConstructedGenericMethod | |
IsConstructor |
Obtiene un valor que indica si el método es un constructor.Gets a value indicating whether the method is a constructor. |
IsFamily |
Obtiene un valor que indica si Family describe la visibilidad de este método o constructor; es decir, el método o el constructor sólo es visible dentro de su clase y clases derivadas.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 |
Obtiene un valor que indica si FamANDAssem describe la visibilidad de este método o constructor; es decir, las clases derivadas pueden llamar al método o constructor, pero sólo si están en el mismo ensamblado.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 |
Obtiene un valor que indica si FamORAssem describe la visibilidad posible de este método o constructor; es decir, las clases derivadas pueden llamar al método o constructor con independencia de dónde se encuentren, así como las clases del mismo ensamblado.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 |
Obtiene un valor que indica si este método es |
IsGenericMethod |
Obtiene un valor que indica si el método es genérico.Gets a value indicating whether the method is generic. |
IsGenericMethodDefinition |
Obtiene un valor que indica si el método es una definición de método genérico.Gets a value indicating whether the method is a generic method definition. |
IsHideBySig |
Obtiene un valor que indica si sólo hay un miembro del mismo tipo y con idéntica firma oculto en la clase derivada.Gets a value indicating whether only a member of the same kind with exactly the same signature is hidden in the derived class. |
IsPrivate |
Obtiene un valor que indica si este miembro es privado.Gets a value indicating whether this member is private. |
IsPublic |
Obtiene un valor que indica si éste es un método público.Gets a value indicating whether this is a public method. |
IsSecurityCritical |
Obtiene un valor que indica si el método o el constructor actual es crítico para la seguridad o es crítico para la seguridad y disponible desde código transparente en el nivel de confianza actual y, por tanto, puede realizar operaciones críticas.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 |
Obtiene un valor que indica si el método o el constructor actual es crítico para la seguridad y disponible desde código transparente en el nivel de confianza actual; es decir, si puede realizar operaciones críticas y está disponible desde código transparente.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 |
Obtiene un valor que indica si el método o el constructor actual es transparente en el nivel de confianza actual y, por tanto, no puede realizar operaciones críticas.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 |
Obtiene un valor que indica si este método tiene un nombre especial.Gets a value indicating whether this method has a special name. |
IsStatic |
Obtiene un valor que indica si el método es |
IsVirtual |
Obtiene un valor que indica si el método es |
MemberType |
Cuando se invalida en una clase derivada, obtiene un valor MemberTypes que indica el tipo de miembro: método, constructor, evento, etc.When overridden in a derived class, gets a MemberTypes value indicating the type of the member - method, constructor, event, and so on. (Heredado de MemberInfo) |
MetadataToken |
Obtiene un valor que identifica un elemento de metadatos.Gets a value that identifies a metadata element. (Heredado de MemberInfo) |
MethodHandle |
Obtiene un identificador para la representación interna de metadatos de un método.Gets a handle to the internal metadata representation of a method. |
MethodImplementationFlags |
Obtiene las marcas MethodImplAttributes que especifican los atributos de una implementación de método.Gets the MethodImplAttributes flags that specify the attributes of a method implementation. |
Module |
Obtiene el módulo en el que el tipo que declara el miembro representado por el objeto MemberInfo actual está definido.Gets the module in which the type that declares the member represented by the current MemberInfo is defined. (Heredado de MemberInfo) |
Name |
Obtiene el nombre del miembro actual.Gets the name of the current member. (Heredado de MemberInfo) |
ReflectedType |
Obtiene el objeto de la clase utilizado para obtener esta instancia de |
Métodos
Equals(Object) |
Devuelve un valor que indica si esta instancia es igual que un objeto especificado.Returns a value that indicates whether this instance is equal to a specified object. |
Equals(Object) |
Devuelve un valor que indica si esta instancia es igual que un objeto especificado.Returns a value that indicates whether this instance is equal to a specified object. (Heredado de MemberInfo) |
GetCurrentMethod() |
Devuelve un objeto |
GetCustomAttributes(Boolean) |
Cuando se reemplaza en una clase derivada, devuelve una matriz de todos los atributos personalizados aplicados a este miembro.When overridden in a derived class, returns an array of all custom attributes applied to this member. (Heredado de MemberInfo) |
GetCustomAttributes(Type, Boolean) |
Cuando se invalida en una clase derivada, devuelve una matriz de atributos personalizados aplicados a este miembro e identificado por Type.When overridden in a derived class, returns an array of custom attributes applied to this member and identified by Type. (Heredado de MemberInfo) |
GetCustomAttributesData() |
Devuelve una lista de objetos CustomAttributeData que representan datos sobre los atributos que se aplicaron al miembro de destino.Returns a list of CustomAttributeData objects representing data about the attributes that have been applied to the target member. (Heredado de MemberInfo) |
GetGenericArguments() |
Devuelve una matriz de objetos Type que representan los argumentos de tipo de un método genérico o los parámetros de tipo de una definición de método genérico.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() |
Devuelve el código hash de esta instancia.Returns the hash code for this instance. |
GetHashCode() |
Devuelve el código hash de esta instancia.Returns the hash code for this instance. (Heredado de MemberInfo) |
GetMethodBody() |
Cuando se reemplaza en una clase derivada, obtiene un objeto MethodBody que proporciona el acceso a la secuencia de MSIL, las variables locales y las excepciones del método actual.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) |
Obtiene información del método por medio de la representación interna de metadatos del método (identificador).Gets method information by using the method's internal metadata representation (handle). |
GetMethodFromHandle(RuntimeMethodHandle, RuntimeTypeHandle) |
Obtiene un objeto MethodBase que corresponde al constructor o el método representado por el identificador especificado, para el tipo genérico especificado.Gets a MethodBase object for the constructor or method represented by the specified handle, for the specified generic type. |
GetMethodImplementationFlags() |
Cuando se reemplaza en una clase derivada, devuelve las marcas MethodImplAttributes.When overridden in a derived class, returns the MethodImplAttributes flags. |
GetParameters() |
Cuando se reemplaza en una clase derivada, obtiene los parámetros del método o constructor especificado.When overridden in a derived class, gets the parameters of the specified method or constructor. |
GetType() | |
GetType() |
Detecta los atributos de un miembro y proporciona acceso a sus metadatos.Discovers the attributes of a member and provides access to member metadata. (Heredado de MemberInfo) |
HasSameMetadataDefinitionAs(MemberInfo) | (Heredado de MemberInfo) |
Invoke(Object, BindingFlags, Binder, Object[], CultureInfo) |
Cuando se reemplaza en una clase derivada, invoca el método o constructor reflejado con los parámetros especificados.When overridden in a derived class, invokes the reflected method or constructor with the given parameters. |
Invoke(Object, Object[]) |
Invoca el método o constructor representado por la instancia actual, utilizando los parámetros especificados.Invokes the method or constructor represented by the current instance, using the specified parameters. |
IsDefined(Type, Boolean) |
Cuando se reemplaza en una clase derivada, indica si se aplican a este miembro uno o más atributos del tipo especificado o de sus tipos derivados.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. (Heredado de MemberInfo) |
MemberwiseClone() |
Crea una copia superficial del Object actual.Creates a shallow copy of the current Object. (Heredado de Object) |
ToString() |
Devuelve una cadena que representa el objeto actual.Returns a string that represents the current object. (Heredado de Object) |
Operadores
Equality(MethodBase, MethodBase) |
Indica si dos objetos MethodBase son iguales.Indicates whether two MethodBase objects are equal. |
Inequality(MethodBase, MethodBase) |
Indica si dos objetos MethodBase no son iguales.Indicates whether two MethodBase objects are not equal. |
Implementaciones de interfaz explícitas
_MemberInfo.GetIDsOfNames(Guid, IntPtr, UInt32, UInt32, IntPtr) |
Asigna un conjunto de nombres a un conjunto correspondiente de identificadores de envío.Maps a set of names to a corresponding set of dispatch identifiers. (Heredado de MemberInfo) |
_MemberInfo.GetType() |
Objeto Type que representa la clase MemberInfo.Gets a Type object representing the MemberInfo class. (Heredado de MemberInfo) |
_MemberInfo.GetTypeInfo(UInt32, UInt32, IntPtr) |
Recupera la información de tipo de un objeto, que se puede usar después para obtener la información de tipo de una interfaz.Retrieves the type information for an object, which can then be used to get the type information for an interface. (Heredado de MemberInfo) |
_MemberInfo.GetTypeInfoCount(UInt32) |
Recupera el número de interfaces de información de tipo que proporciona un objeto (0 ó 1).Retrieves the number of type information interfaces that an object provides (either 0 or 1). (Heredado de MemberInfo) |
_MemberInfo.Invoke(UInt32, Guid, UInt32, Int16, IntPtr, IntPtr, IntPtr, IntPtr) |
Proporciona acceso a las propiedades y los métodos expuestos por un objeto.Provides access to properties and methods exposed by an object. (Heredado de MemberInfo) |
_MethodBase.GetIDsOfNames(Guid, IntPtr, UInt32, UInt32, IntPtr) |
Asigna un conjunto de nombres a un conjunto correspondiente de identificadores de envío.Maps a set of names to a corresponding set of dispatch identifiers. |
_MethodBase.GetType() |
Para obtener una descripción de este miembro, vea GetType().For a description of this member, see GetType(). |
_MethodBase.GetTypeInfo(UInt32, UInt32, IntPtr) |
Recupera la información de tipo de un objeto, que se puede usar después para obtener la información de tipo de una interfaz.Retrieves the type information for an object, which can then be used to get the type information for an interface. |
_MethodBase.GetTypeInfoCount(UInt32) |
Recupera el número de interfaces de información de tipo que proporciona un objeto (0 ó 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) |
Proporciona acceso a las propiedades y los métodos expuestos por un objeto.Provides access to properties and methods exposed by an object. |
_MethodBase.IsAbstract |
Para obtener una descripción de este miembro, vea IsAbstract.For a description of this member, see IsAbstract. |
_MethodBase.IsAssembly |
Para obtener una descripción de este miembro, vea IsAssembly.For a description of this member, see IsAssembly. |
_MethodBase.IsConstructor |
Para obtener una descripción de este miembro, vea IsConstructor.For a description of this member, see IsConstructor. |
_MethodBase.IsFamily |
Para obtener una descripción de este miembro, vea IsFamily.For a description of this member, see IsFamily. |
_MethodBase.IsFamilyAndAssembly |
Para obtener una descripción de este miembro, vea IsFamilyAndAssembly.For a description of this member, see IsFamilyAndAssembly. |
_MethodBase.IsFamilyOrAssembly |
Para obtener una descripción de este miembro, vea IsFamilyOrAssembly.For a description of this member, see IsFamilyOrAssembly. |
_MethodBase.IsFinal |
Para obtener una descripción de este miembro, vea IsFinal.For a description of this member, see IsFinal. |
_MethodBase.IsHideBySig |
Para obtener una descripción de este miembro, vea IsHideBySig.For a description of this member, see IsHideBySig. |
_MethodBase.IsPrivate |
Para obtener una descripción de este miembro, vea IsPrivate.For a description of this member, see IsPrivate. |
_MethodBase.IsPublic |
Para obtener una descripción de este miembro, vea IsPublic.For a description of this member, see IsPublic. |
_MethodBase.IsSpecialName |
Para obtener una descripción de este miembro, vea IsSpecialName.For a description of this member, see IsSpecialName. |
_MethodBase.IsStatic |
Para obtener una descripción de este miembro, vea IsStatic.For a description of this member, see IsStatic. |
_MethodBase.IsVirtual |
Para obtener una descripción de este miembro, vea IsVirtual.For a description of this member, see IsVirtual. |
ICustomAttributeProvider.GetCustomAttributes(Boolean) |
Devuelve una matriz de todos los atributos personalizados definidos en este miembro, excluidos los atributos con nombre, o una matriz vacía si no hay atributos personalizados.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. (Heredado de MemberInfo) |
ICustomAttributeProvider.GetCustomAttributes(Type, Boolean) |
Devuelve una matriz de atributos personalizados definidos en este miembro, identificados por tipo, o una matriz vacía si no hay atributos personalizados de ese tipo.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. (Heredado de MemberInfo) |
ICustomAttributeProvider.IsDefined(Type, Boolean) |
Indica si una o más instancias de |
Métodos de extensión
GetCustomAttribute(MemberInfo, Type) |
Recupera un atributo personalizado de un tipo especificado que se aplica a un miembro concreto.Retrieves a custom attribute of a specified type that is applied to a specified member. |
GetCustomAttribute(MemberInfo, Type, Boolean) |
Recupera un atributo personalizado de un tipo especificado que se aplica a un miembro concreto y, opcionalmente, inspecciona los antecesores de dicho miembro.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) |
Recupera un atributo personalizado de un tipo especificado que se aplica a un miembro concreto.Retrieves a custom attribute of a specified type that is applied to a specified member. |
GetCustomAttribute<T>(MemberInfo, Boolean) |
Recupera un atributo personalizado de un tipo especificado que se aplica a un miembro concreto y, opcionalmente, inspecciona los antecesores de dicho miembro.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) |
Recupera una colección de atributos personalizados que se aplican a un miembro especificado.Retrieves a collection of custom attributes that are applied to a specified member. |
GetCustomAttributes(MemberInfo, Boolean) |
Recupera una colección de atributos personalizados que se aplican a un miembro concreto y, opcionalmente, inspecciona los antecesores de dicho miembro.Retrieves a collection of custom attributes that are applied to a specified member, and optionally inspects the ancestors of that member. |
GetCustomAttributes(MemberInfo, Type) |
Recupera una colección de atributos personalizados de un tipo especificado que se aplican a un miembro concreto.Retrieves a collection of custom attributes of a specified type that are applied to a specified member. |
GetCustomAttributes(MemberInfo, Type, Boolean) |
Recupera una colección de atributos personalizados de un tipo especificado que se aplican a un miembro concreto y, opcionalmente, inspecciona los antecesores de dicho miembro.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) |
Recupera una colección de atributos personalizados de un tipo especificado que se aplican a un miembro concreto.Retrieves a collection of custom attributes of a specified type that are applied to a specified member. |
GetCustomAttributes<T>(MemberInfo, Boolean) |
Recupera una colección de atributos personalizados de un tipo especificado que se aplican a un miembro concreto y, opcionalmente, inspecciona los antecesores de dicho miembro.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) |
Indica si se deben aplicar atributos personalizados de un tipo especificado a un miembro especificado.Indicates whether custom attributes of a specified type are applied to a specified member. |
IsDefined(MemberInfo, Type, Boolean) |
Indica si los atributos personalizados de un tipo especificado se aplican a un miembro especificado y, opcionalmente, se aplican a sus antecesores.Indicates whether custom attributes of a specified type are applied to a specified member, and, optionally, applied to its ancestors. |
GetMetadataToken(MemberInfo) |
Obtiene un token de metadatos del miembro determinado, si está disponible.Gets a metadata token for the given member, if available. |
HasMetadataToken(MemberInfo) |
Devuelve un valor que indica si un token de metadatos está disponible para el miembro especificado.Returns a value that indicates whether a metadata token is available for the specified member. |
Se aplica a
Seguridad para subprocesos
Este tipo es seguro para la ejecución de subprocesos.This type is thread safe.