MethodBuilder Classe
Definizione
Importante
Alcune informazioni sono relative alla release non definitiva del prodotto, che potrebbe subire modifiche significative prima della release definitiva. Microsoft non riconosce alcuna garanzia, espressa o implicita, in merito alle informazioni qui fornite.
Definisce e rappresenta un metodo (o costruttore) in una classe dinamica.
public ref class MethodBuilder sealed : System::Reflection::MethodInfo, System::Runtime::InteropServices::_MethodBuilder
public ref class MethodBuilder sealed : System::Reflection::MethodInfo
[System.Runtime.InteropServices.ClassInterface(System.Runtime.InteropServices.ClassInterfaceType.None)]
public sealed class MethodBuilder : System.Reflection.MethodInfo, System.Runtime.InteropServices._MethodBuilder
[System.Runtime.InteropServices.ClassInterface(System.Runtime.InteropServices.ClassInterfaceType.None)]
[System.Runtime.InteropServices.ComVisible(true)]
public sealed class MethodBuilder : System.Reflection.MethodInfo, System.Runtime.InteropServices._MethodBuilder
public sealed class MethodBuilder : System.Reflection.MethodInfo
[<System.Runtime.InteropServices.ClassInterface(System.Runtime.InteropServices.ClassInterfaceType.None)>]
type MethodBuilder = class
inherit MethodInfo
interface _MethodBuilder
[<System.Runtime.InteropServices.ClassInterface(System.Runtime.InteropServices.ClassInterfaceType.None)>]
[<System.Runtime.InteropServices.ComVisible(true)>]
type MethodBuilder = class
inherit MethodInfo
interface _MethodBuilder
type MethodBuilder = class
inherit MethodInfo
Public NotInheritable Class MethodBuilder
Inherits MethodInfo
Implements _MethodBuilder
Public NotInheritable Class MethodBuilder
Inherits MethodInfo
- Ereditarietà
- Attributi
- Implementazioni
Esempio
Nell'esempio seguente viene utilizzata la MethodBuilder classe per creare un metodo all'interno di un tipo dinamico.
using System;
using System.Reflection;
using System.Reflection.Emit;
class DemoMethodBuilder
{
public static void AddMethodDynamically (TypeBuilder myTypeBld,
string mthdName,
Type[] mthdParams,
Type returnType,
string mthdAction)
{
MethodBuilder myMthdBld = myTypeBld.DefineMethod(
mthdName,
MethodAttributes.Public |
MethodAttributes.Static,
returnType,
mthdParams);
ILGenerator ILout = myMthdBld.GetILGenerator();
int numParams = mthdParams.Length;
for (byte x=0; x < numParams; x++)
{
ILout.Emit(OpCodes.Ldarg_S, x);
}
if (numParams > 1)
{
for (int y=0; y<(numParams-1); y++)
{
switch (mthdAction)
{
case "A": ILout.Emit(OpCodes.Add);
break;
case "M": ILout.Emit(OpCodes.Mul);
break;
default: ILout.Emit(OpCodes.Add);
break;
}
}
}
ILout.Emit(OpCodes.Ret);
}
public static void Main()
{
AppDomain myDomain = AppDomain.CurrentDomain;
AssemblyName asmName = new AssemblyName();
asmName.Name = "MyDynamicAsm";
AssemblyBuilder myAsmBuilder = myDomain.DefineDynamicAssembly(
asmName,
AssemblyBuilderAccess.RunAndSave);
ModuleBuilder myModule = myAsmBuilder.DefineDynamicModule("MyDynamicAsm",
"MyDynamicAsm.dll");
TypeBuilder myTypeBld = myModule.DefineType("MyDynamicType",
TypeAttributes.Public);
// Get info from the user to build the method dynamically.
Console.WriteLine("Let's build a simple method dynamically!");
Console.WriteLine("Please enter a few numbers, separated by spaces.");
string inputNums = Console.ReadLine();
Console.Write("Do you want to [A]dd (default) or [M]ultiply these numbers? ");
string myMthdAction = Console.ReadLine().ToUpper();
Console.Write("Lastly, what do you want to name your new dynamic method? ");
string myMthdName = Console.ReadLine();
// Process inputNums into an array and create a corresponding Type array
int index = 0;
string[] inputNumsList = inputNums.Split();
Type[] myMthdParams = new Type[inputNumsList.Length];
object[] inputValsList = new object[inputNumsList.Length];
foreach (string inputNum in inputNumsList)
{
inputValsList[index] = (object)Convert.ToInt32(inputNum);
myMthdParams[index] = typeof(int);
index++;
}
// Now, call the method building method with the parameters, passing the
// TypeBuilder by reference.
AddMethodDynamically(myTypeBld,
myMthdName,
myMthdParams,
typeof(int),
myMthdAction);
Type myType = myTypeBld.CreateType();
Console.WriteLine("---");
Console.WriteLine("The result of {0} the inputted values is: {1}",
((myMthdAction == "M") ? "multiplying" : "adding"),
myType.InvokeMember(myMthdName,
BindingFlags.InvokeMethod | BindingFlags.Public |
BindingFlags.Static,
null,
null,
inputValsList));
Console.WriteLine("---");
// Let's take a look at the method we created.
// If you are interested in seeing the MSIL generated dynamically for the method
// your program generated, change to the directory where you ran the compiled
// code sample and type "ildasm MyDynamicAsm.dll" at the prompt. When the list
// of manifest contents appears, click on "MyDynamicType" and then on the name of
// of the method you provided during execution.
myAsmBuilder.Save("MyDynamicAsm.dll");
MethodInfo myMthdInfo = myType.GetMethod(myMthdName);
Console.WriteLine("Your Dynamic Method: {0};", myMthdInfo.ToString());
}
}
Imports System.Reflection
Imports System.Reflection.Emit
Class DemoMethodBuilder
Public Shared Sub AddMethodDynamically(ByVal myTypeBld As TypeBuilder, _
ByVal mthdName As String, _
ByVal mthdParams() As Type, _
ByVal returnType As Type, _
ByVal mthdAction As String)
Dim myMthdBld As MethodBuilder = myTypeBld.DefineMethod(mthdName, _
MethodAttributes.Public Or MethodAttributes.Static, _
returnType, _
mthdParams)
Dim ILout As ILGenerator = myMthdBld.GetILGenerator()
Dim numParams As Integer = mthdParams.Length
Dim x As Byte
For x = 0 To numParams - 1
ILout.Emit(OpCodes.Ldarg_S, x)
Next x
If numParams > 1 Then
Dim y As Integer
For y = 0 To (numParams - 1) - 1
Select Case mthdAction
Case "A"
ILout.Emit(OpCodes.Add)
Case "M"
ILout.Emit(OpCodes.Mul)
Case Else
ILout.Emit(OpCodes.Add)
End Select
Next y
End If
ILout.Emit(OpCodes.Ret)
End Sub
Public Shared Sub Main()
Dim myDomain As AppDomain = AppDomain.CurrentDomain
Dim asmName As New AssemblyName()
asmName.Name = "MyDynamicAsm"
Dim myAsmBuilder As AssemblyBuilder = myDomain.DefineDynamicAssembly(asmName, _
AssemblyBuilderAccess.RunAndSave)
Dim myModule As ModuleBuilder = myAsmBuilder.DefineDynamicModule("MyDynamicAsm", _
"MyDynamicAsm.dll")
Dim myTypeBld As TypeBuilder = myModule.DefineType("MyDynamicType", TypeAttributes.Public)
' Get info from the user to build the method dynamically.
Console.WriteLine("Let's build a simple method dynamically!")
Console.WriteLine("Please enter a few numbers, separated by spaces.")
Dim inputNums As String = Console.ReadLine()
Console.Write("Do you want to [A]dd (default) or [M]ultiply these numbers? ")
Dim myMthdAction As String = Console.ReadLine().ToUpper()
Console.Write("Lastly, what do you want to name your new dynamic method? ")
Dim myMthdName As String = Console.ReadLine()
' Process inputNums into an array and create a corresponding Type array
Dim index As Integer = 0
Dim inputNumsList As String() = inputNums.Split()
Dim myMthdParams(inputNumsList.Length - 1) As Type
Dim inputValsList(inputNumsList.Length - 1) As Object
Dim inputNum As String
For Each inputNum In inputNumsList
inputValsList(index) = CType(Convert.ToInt32(inputNum), Object)
myMthdParams(index) = GetType(Integer)
index += 1
Next inputNum
' Now, call the method building method with the parameters, passing the
' TypeBuilder by reference.
AddMethodDynamically(myTypeBld, myMthdName, myMthdParams, GetType(Integer), myMthdAction)
Dim myType As Type = myTypeBld.CreateType()
Dim description as String
If myMthdAction = "M" Then
description = "multiplying"
Else
description = "adding"
End If
Console.WriteLine("---")
Console.WriteLine("The result of {0} the values is: {1}", _
description, _
myType.InvokeMember(myMthdName, _
BindingFlags.InvokeMethod _
Or BindingFlags.Public _
Or BindingFlags.Static, _
Nothing, _
Nothing, _
inputValsList))
Console.WriteLine("---")
' If you are interested in seeing the MSIL generated dynamically for the method
' your program generated, change to the directory where you ran the compiled
' code sample and type "ildasm MyDynamicAsm.dll" at the prompt. When the list
' of manifest contents appears, click on "MyDynamicType" and then on the name of
' of the method you provided during execution.
myAsmBuilder.Save("MyDynamicAsm.dll")
Dim myMthdInfo As MethodInfo = myType.GetMethod(myMthdName)
Console.WriteLine("Your Dynamic Method: {0};", myMthdInfo.ToString())
End Sub
End Class
Commenti
Per altre informazioni su questa API, vedere Osservazioni supplementari sulle API per MethodBuilder.
Proprietà
| Nome | Descrizione |
|---|---|
| Attributes |
Recupera gli attributi per questo metodo. |
| CallingConvention |
Restituisce la convenzione di chiamata del metodo . |
| ContainsGenericParameters |
Non supportato per questo tipo. |
| CustomAttributes |
Ottiene una raccolta contenente gli attributi personalizzati di questo membro. (Ereditato da MemberInfo) |
| DeclaringType |
Restituisce il tipo che dichiara questo metodo. |
| InitLocals |
Ottiene o imposta un valore booleano che specifica se le variabili locali in questo metodo sono zero inizializzate. Il valore predefinito di questa proprietà è |
| IsAbstract |
Ottiene un valore che indica se il metodo è astratto. (Ereditato da MethodBase) |
| IsAssembly |
Ottiene un valore che indica se la visibilità potenziale di questo metodo o costruttore è descritta da Assembly, ovvero il metodo o il costruttore è visibile al massimo ad altri tipi nello stesso assembly e non è visibile ai tipi derivati all'esterno dell'assembly. (Ereditato da MethodBase) |
| IsConstructedGenericMethod |
Definisce e rappresenta un metodo (o costruttore) in una classe dinamica. |
| IsConstructor |
Ottiene un valore che indica se il metodo è un costruttore. (Ereditato da MethodBase) |
| IsFamily |
Ottiene un valore che indica se la visibilità di questo metodo o costruttore è descritta da Family, ovvero il metodo o il costruttore è visibile solo all'interno della classe e delle classi derivate. (Ereditato da MethodBase) |
| IsFamilyAndAssembly |
Ottiene un valore che indica se la visibilità di questo metodo o costruttore è descritta da FamANDAssem, ovvero il metodo o il costruttore può essere chiamato da classi derivate, ma solo se si trovano nello stesso assembly. (Ereditato da MethodBase) |
| IsFamilyOrAssembly |
Ottiene un valore che indica se la visibilità potenziale di questo metodo o costruttore è descritta da FamORAssem, ovvero il metodo o il costruttore può essere chiamato da classi derivate ovunque si trovino e da classi nello stesso assembly. (Ereditato da MethodBase) |
| IsFinal |
Ottiene un valore che indica se questo metodo è |
| IsGenericMethod |
Ottiene un valore che indica se il metodo è un metodo generico. |
| IsGenericMethodDefinition |
Ottiene un valore che indica se l'oggetto corrente MethodBuilder rappresenta la definizione di un metodo generico. |
| IsHideBySig |
Ottiene un valore che indica se solo un membro dello stesso tipo con esattamente la stessa firma è nascosto nella classe derivata. (Ereditato da MethodBase) |
| IsPrivate |
Ottiene un valore che indica se il membro è privato. (Ereditato da MethodBase) |
| IsPublic |
Ottiene un valore che indica se si tratta di un metodo pubblico. (Ereditato da MethodBase) |
| IsSecurityCritical |
Genera un oggetto NotSupportedException in tutti i casi. |
| IsSecurityCritical |
Ottiene un valore che indica se il metodo o il costruttore corrente è critico per la sicurezza o per la sicurezza a livello di attendibilità corrente e pertanto può eseguire operazioni critiche. (Ereditato da MethodBase) |
| IsSecuritySafeCritical |
Genera un oggetto NotSupportedException in tutti i casi. |
| IsSecuritySafeCritical |
Ottiene un valore che indica se il metodo o il costruttore corrente è critico per la sicurezza a livello di attendibilità corrente; ovvero se può eseguire operazioni critiche e può essere accessibile tramite codice trasparente. (Ereditato da MethodBase) |
| IsSecurityTransparent |
Genera un oggetto NotSupportedException in tutti i casi. |
| IsSecurityTransparent |
Ottiene un valore che indica se il metodo o il costruttore corrente è trasparente a livello di trust corrente e pertanto non può eseguire operazioni critiche. (Ereditato da MethodBase) |
| IsSpecialName |
Ottiene un valore che indica se questo metodo ha un nome speciale. (Ereditato da MethodBase) |
| IsStatic |
Ottiene un valore che indica se il metodo è |
| IsVirtual |
Ottiene un valore che indica se il metodo è |
| MemberType |
Ottiene un MemberTypes valore che indica che questo membro è un metodo. (Ereditato da MethodInfo) |
| MetadataToken |
Ottiene un valore che identifica un elemento di metadati. (Ereditato da MemberInfo) |
| MethodHandle |
Recupera l'handle interno per il metodo . Usare questo handle per accedere all'handle di metadati sottostante. |
| MethodImplementationFlags |
Ottiene i MethodImplAttributes flag che specificano gli attributi di un'implementazione di un metodo. (Ereditato da MethodBase) |
| Module |
Ottiene il modulo in cui viene definito il metodo corrente. |
| Name |
Recupera il nome di questo metodo. |
| ReflectedType |
Recupera la classe utilizzata nella reflection per ottenere questo oggetto. |
| ReturnParameter |
Ottiene un ParameterInfo oggetto che contiene informazioni sul tipo restituito del metodo, ad esempio se il tipo restituito dispone di modificatori personalizzati. |
| ReturnType |
Ottiene il tipo restituito del metodo rappresentato da questo MethodBuilderoggetto . |
| ReturnType |
Ottiene il tipo restituito di questo metodo. (Ereditato da MethodInfo) |
| ReturnTypeCustomAttributes |
Restituisce gli attributi personalizzati del tipo restituito del metodo. |
| Signature |
Recupera la firma del metodo . |
Metodi
| Nome | Descrizione |
|---|---|
| AddDeclarativeSecurity(SecurityAction, PermissionSet) |
Aggiunge sicurezza dichiarativa a questo metodo. |
| CreateDelegate(Type, Object) |
Crea un delegato del tipo specificato con la destinazione specificata da questo metodo. (Ereditato da MethodInfo) |
| CreateDelegate(Type) |
Crea un delegato del tipo specificato da questo metodo. (Ereditato da MethodInfo) |
| CreateMethodBody(Byte[], Int32) |
Crea il corpo del metodo usando una matrice di byte fornita di Microsoft istruzioni MSIL (Intermediate Language). |
| DefineGenericParameters(String[]) |
Imposta il numero di parametri di tipo generico per il metodo corrente, ne specifica i nomi e restituisce una matrice di GenericTypeParameterBuilder oggetti che possono essere utilizzati per definire i relativi vincoli. |
| DefineParameter(Int32, ParameterAttributes, String) |
Imposta gli attributi del parametro e il nome di un parametro di questo metodo o del valore restituito di questo metodo. Restituisce un ParameterBuilder che può essere usato per applicare attributi personalizzati. |
| Equals(Object) |
Determina se l'oggetto specificato è uguale a questa istanza. |
| GetBaseDefinition() |
Restituisce l'implementazione di base per un metodo. |
| GetCustomAttributes(Boolean) |
Restituisce tutti gli attributi personalizzati definiti per questo metodo. |
| GetCustomAttributes(Type, Boolean) |
Restituisce gli attributi personalizzati identificati dal tipo specificato. |
| GetCustomAttributesData() |
Restituisce un elenco di CustomAttributeData oggetti che rappresentano i dati sugli attributi applicati al membro di destinazione. (Ereditato da MemberInfo) |
| GetGenericArguments() |
Restituisce una matrice di GenericTypeParameterBuilder oggetti che rappresentano i parametri di tipo del metodo, se è generico. |
| GetGenericMethodDefinition() |
Restituisce questo metodo. |
| GetHashCode() |
Ottiene il codice hash per questo metodo. |
| GetILGenerator() |
Restituisce un |
| GetILGenerator(Int32) |
Restituisce un |
| GetMethodBody() |
In caso di override in una classe derivata, ottiene un MethodBody oggetto che fornisce l'accesso al flusso MSIL, alle variabili locali e alle eccezioni per il metodo corrente. (Ereditato da MethodBase) |
| GetMethodImplementationFlags() |
Restituisce i flag di implementazione per il metodo . |
| GetModule() |
Restituisce un riferimento al modulo che contiene questo metodo. |
| GetParameters() |
Restituisce i parametri di questo metodo. |
| GetToken() |
Restituisce l'oggetto |
| GetType() |
Individua gli attributi di un metodo e fornisce l'accesso ai metadati del metodo. (Ereditato da MethodInfo) |
| HasSameMetadataDefinitionAs(MemberInfo) |
Definisce e rappresenta un metodo (o costruttore) in una classe dinamica. (Ereditato da MemberInfo) |
| Invoke(Object, BindingFlags, Binder, Object[], CultureInfo) |
Richiama dinamicamente il metodo riflesso da questa istanza sull'oggetto specificato, passando i parametri specificati e sotto i vincoli del gestore di associazione specificato. |
| Invoke(Object, Object[]) |
Richiama il metodo o il costruttore rappresentato dall'istanza corrente, utilizzando i parametri specificati. (Ereditato da MethodInfo) |
| IsDefined(Type, Boolean) |
Controlla se è definito il tipo di attributo personalizzato specificato. |
| MakeGenericMethod(Type[]) |
Restituisce un metodo generico costruito dalla definizione del metodo generico corrente utilizzando gli argomenti di tipo generico specificati. |
| MemberwiseClone() |
Crea una copia superficiale del Objectcorrente. (Ereditato da Object) |
| SetCustomAttribute(ConstructorInfo, Byte[]) |
Imposta un attributo personalizzato usando un BLOB di attributi personalizzato specificato. |
| SetCustomAttribute(CustomAttributeBuilder) |
Imposta un attributo personalizzato usando un generatore di attributi personalizzato. |
| SetImplementationFlags(MethodImplAttributes) |
Imposta i flag di implementazione per questo metodo. |
| SetMarshal(UnmanagedMarshal) |
Obsoleti.
Imposta le informazioni di marshalling per il tipo restituito di questo metodo. |
| SetMethodBody(Byte[], Int32, Byte[], IEnumerable<ExceptionHandler>, IEnumerable<Int32>) |
Crea il corpo del metodo utilizzando una matrice di byte specificata di Microsoft istruzioni MSIL (Intermediate Language). |
| SetParameters(Type[]) |
Imposta il numero e i tipi di parametri per un metodo. |
| SetReturnType(Type) |
Imposta il tipo restituito del metodo . |
| SetSignature(Type, Type[], Type[], Type[], Type[][], Type[][]) |
Imposta la firma del metodo, inclusi il tipo restituito, i tipi di parametro e i modificatori personalizzati obbligatori e facoltativi dei tipi di parametro e del tipo restituito. |
| SetSymCustomAttribute(String, Byte[]) |
Impostare un attributo personalizzato simbolico usando un BLOB. |
| ToString() |
Restituisce questa |
Implementazioni dell'interfaccia esplicita
| Nome | Descrizione |
|---|---|
| _MemberInfo.GetIDsOfNames(Guid, IntPtr, UInt32, UInt32, IntPtr) |
Esegue il mapping di un set di nomi a un set corrispondente di identificatori dispatch. (Ereditato da MemberInfo) |
| _MemberInfo.GetType() |
Ottiene un Type oggetto che rappresenta la MemberInfo classe . (Ereditato da MemberInfo) |
| _MemberInfo.GetTypeInfo(UInt32, UInt32, IntPtr) |
Recupera le informazioni sul tipo relative a un oggetto che può quindi essere usato per ottenere informazioni sul tipo relative a un'interfaccia. (Ereditato da MemberInfo) |
| _MemberInfo.GetTypeInfoCount(UInt32) |
Recupera il numero di interfacce di informazioni sul tipo fornite da un oggetto (0 o 1). (Ereditato da MemberInfo) |
| _MemberInfo.Invoke(UInt32, Guid, UInt32, Int16, IntPtr, IntPtr, IntPtr, IntPtr) |
Fornisce l'accesso alle proprietà e ai metodi esposti da un oggetto . (Ereditato da MemberInfo) |
| _MethodBase.GetIDsOfNames(Guid, IntPtr, UInt32, UInt32, IntPtr) |
Esegue il mapping di un set di nomi a un set corrispondente di identificatori dispatch. (Ereditato da MethodBase) |
| _MethodBase.GetType() |
Per una descrizione di questo membro, vedere GetType(). (Ereditato da MethodBase) |
| _MethodBase.GetTypeInfo(UInt32, UInt32, IntPtr) |
Recupera le informazioni sul tipo relative a un oggetto che può quindi essere usato per ottenere informazioni sul tipo relative a un'interfaccia. (Ereditato da MethodBase) |
| _MethodBase.GetTypeInfoCount(UInt32) |
Recupera il numero di interfacce di informazioni sul tipo fornite da un oggetto (0 o 1). (Ereditato da MethodBase) |
| _MethodBase.Invoke(UInt32, Guid, UInt32, Int16, IntPtr, IntPtr, IntPtr, IntPtr) |
Fornisce l'accesso alle proprietà e ai metodi esposti da un oggetto . (Ereditato da MethodBase) |
| _MethodBase.IsAbstract |
Per una descrizione di questo membro, vedere IsAbstract. (Ereditato da MethodBase) |
| _MethodBase.IsAssembly |
Per una descrizione di questo membro, vedere IsAssembly. (Ereditato da MethodBase) |
| _MethodBase.IsConstructor |
Per una descrizione di questo membro, vedere IsConstructor. (Ereditato da MethodBase) |
| _MethodBase.IsFamily |
Per una descrizione di questo membro, vedere IsFamily. (Ereditato da MethodBase) |
| _MethodBase.IsFamilyAndAssembly |
Per una descrizione di questo membro, vedere IsFamilyAndAssembly. (Ereditato da MethodBase) |
| _MethodBase.IsFamilyOrAssembly |
Per una descrizione di questo membro, vedere IsFamilyOrAssembly. (Ereditato da MethodBase) |
| _MethodBase.IsFinal |
Per una descrizione di questo membro, vedere IsFinal. (Ereditato da MethodBase) |
| _MethodBase.IsHideBySig |
Per una descrizione di questo membro, vedere IsHideBySig. (Ereditato da MethodBase) |
| _MethodBase.IsPrivate |
Per una descrizione di questo membro, vedere IsPrivate. (Ereditato da MethodBase) |
| _MethodBase.IsPublic |
Per una descrizione di questo membro, vedere IsPublic. (Ereditato da MethodBase) |
| _MethodBase.IsSpecialName |
Per una descrizione di questo membro, vedere IsSpecialName. (Ereditato da MethodBase) |
| _MethodBase.IsStatic |
Per una descrizione di questo membro, vedere IsStatic. (Ereditato da MethodBase) |
| _MethodBase.IsVirtual |
Per una descrizione di questo membro, vedere IsVirtual. (Ereditato da MethodBase) |
| _MethodBuilder.GetIDsOfNames(Guid, IntPtr, UInt32, UInt32, IntPtr) |
Esegue il mapping di un set di nomi a un set corrispondente di identificatori dispatch. |
| _MethodBuilder.GetTypeInfo(UInt32, UInt32, IntPtr) |
Recupera le informazioni sul tipo relative a un oggetto che può quindi essere usato per ottenere informazioni sul tipo relative a un'interfaccia. |
| _MethodBuilder.GetTypeInfoCount(UInt32) |
Recupera il numero di interfacce di informazioni sul tipo fornite da un oggetto (0 o 1). |
| _MethodBuilder.Invoke(UInt32, Guid, UInt32, Int16, IntPtr, IntPtr, IntPtr, IntPtr) |
Fornisce l'accesso alle proprietà e ai metodi esposti da un oggetto . |
| _MethodInfo.GetIDsOfNames(Guid, IntPtr, UInt32, UInt32, IntPtr) |
Esegue il mapping di un set di nomi a un set corrispondente di identificatori dispatch. (Ereditato da MethodInfo) |
| _MethodInfo.GetType() |
Fornisce l'accesso GetType() al metodo da COM. (Ereditato da MethodInfo) |
| _MethodInfo.GetTypeInfo(UInt32, UInt32, IntPtr) |
Recupera le informazioni sul tipo per un oggetto, che può essere utilizzato per ottenere le informazioni sul tipo per un'interfaccia. (Ereditato da MethodInfo) |
| _MethodInfo.GetTypeInfoCount(UInt32) |
Recupera il numero di interfacce di informazioni sul tipo fornite da un oggetto (0 o 1). (Ereditato da MethodInfo) |
| _MethodInfo.Invoke(UInt32, Guid, UInt32, Int16, IntPtr, IntPtr, IntPtr, IntPtr) |
Fornisce l'accesso alle proprietà e ai metodi esposti da un oggetto . (Ereditato da MethodInfo) |
Metodi di estensione
| Nome | Descrizione |
|---|---|
| GetCustomAttribute(MemberInfo, Type, Boolean) |
Recupera un attributo personalizzato di un tipo specificato applicato a un membro specificato e, facoltativamente, controlla i predecessori di tale membro. |
| GetCustomAttribute(MemberInfo, Type) |
Recupera un attributo personalizzato di un tipo specificato applicato a un membro specificato. |
| GetCustomAttribute<T>(MemberInfo, Boolean) |
Recupera un attributo personalizzato di un tipo specificato applicato a un membro specificato e, facoltativamente, controlla i predecessori di tale membro. |
| GetCustomAttribute<T>(MemberInfo) |
Recupera un attributo personalizzato di un tipo specificato applicato a un membro specificato. |
| GetCustomAttributes(MemberInfo, Boolean) |
Recupera una raccolta di attributi personalizzati applicati a un membro specificato e, facoltativamente, controlla i predecessori di tale membro. |
| GetCustomAttributes(MemberInfo, Type, Boolean) |
Recupera una raccolta di attributi personalizzati di un tipo specificato applicato a un membro specificato e, facoltativamente, controlla i predecessori di tale membro. |
| GetCustomAttributes(MemberInfo, Type) |
Recupera una raccolta di attributi personalizzati di un tipo specificato applicato a un membro specificato. |
| GetCustomAttributes(MemberInfo) |
Recupera una raccolta di attributi personalizzati applicati a un membro specificato. |
| GetCustomAttributes<T>(MemberInfo, Boolean) |
Recupera una raccolta di attributi personalizzati di un tipo specificato applicato a un membro specificato e, facoltativamente, controlla i predecessori di tale membro. |
| GetCustomAttributes<T>(MemberInfo) |
Recupera una raccolta di attributi personalizzati di un tipo specificato applicato a un membro specificato. |
| GetRuntimeBaseDefinition(MethodInfo) |
Recupera un oggetto che rappresenta il metodo specificato nella classe base diretta o indiretta in cui il metodo è stato dichiarato per la prima volta. |
| IsDefined(MemberInfo, Type, Boolean) |
Indica se gli attributi personalizzati di un tipo specificato vengono applicati a un membro specificato e, facoltativamente, applicati ai relativi predecessori. |
| IsDefined(MemberInfo, Type) |
Indica se gli attributi personalizzati di un tipo specificato vengono applicati a un membro specificato. |