ConstructorBuilder ConstructorBuilder ConstructorBuilder ConstructorBuilder Class

Definición

Define y representa a un constructor de una clase dinámica.Defines and represents a constructor of a dynamic class.

public ref class ConstructorBuilder sealed : System::Reflection::ConstructorInfo, System::Runtime::InteropServices::_ConstructorBuilder
[System.Runtime.InteropServices.ClassInterface(System.Runtime.InteropServices.ClassInterfaceType.None)]
[System.Runtime.InteropServices.ComVisible(true)]
public sealed class ConstructorBuilder : System.Reflection.ConstructorInfo, System.Runtime.InteropServices._ConstructorBuilder
type ConstructorBuilder = class
    inherit ConstructorInfo
    interface _ConstructorBuilder
Public NotInheritable Class ConstructorBuilder
Inherits ConstructorInfo
Implements _ConstructorBuilder
Herencia
Atributos
Implementaciones

Ejemplos

Ejemplo de código siguiente muestra el uso contextual de un ConstructorBuilder.The following code sample illustrates the contextual usage of a ConstructorBuilder.

using namespace System;
using namespace System::Threading;
using namespace System::Reflection;
using namespace System::Reflection::Emit;
Type^ DynamicPointTypeGen()
{
   Type^ pointType = nullptr;
   array<Type^>^temp0 = {int::typeid,int::typeid,int::typeid};
   array<Type^>^ctorParams = temp0;
   AppDomain^ myDomain = Thread::GetDomain();
   AssemblyName^ myAsmName = gcnew AssemblyName;
   myAsmName->Name = "MyDynamicAssembly";
   AssemblyBuilder^ myAsmBuilder = myDomain->DefineDynamicAssembly( myAsmName, AssemblyBuilderAccess::RunAndSave );
   ModuleBuilder^ pointModule = myAsmBuilder->DefineDynamicModule( "PointModule", "Point.dll" );
   TypeBuilder^ pointTypeBld = pointModule->DefineType( "Point", TypeAttributes::Public );
   FieldBuilder^ xField = pointTypeBld->DefineField( "x", int::typeid, FieldAttributes::Public );
   FieldBuilder^ yField = pointTypeBld->DefineField( "y", int::typeid, FieldAttributes::Public );
   FieldBuilder^ zField = pointTypeBld->DefineField( "z", int::typeid, FieldAttributes::Public );
   Type^ objType = Type::GetType( "System.Object" );
   ConstructorInfo^ objCtor = objType->GetConstructor( gcnew array<Type^>(0) );
   ConstructorBuilder^ pointCtor = pointTypeBld->DefineConstructor( MethodAttributes::Public, CallingConventions::Standard, ctorParams );
   ILGenerator^ ctorIL = pointCtor->GetILGenerator();
   
   // NOTE: ldarg.0 holds the "this" reference - ldarg.1, ldarg.2, and ldarg.3
   // hold the actual passed parameters. ldarg.0 is used by instance methods
   // to hold a reference to the current calling bject instance. Static methods
   // do not use arg.0, since they are not instantiated and hence no reference
   // is needed to distinguish them.
   ctorIL->Emit( OpCodes::Ldarg_0 );
   
   // Here, we wish to create an instance of System::Object by invoking its
   // constructor, as specified above.
   ctorIL->Emit( OpCodes::Call, objCtor );
   
   // Now, we'll load the current instance in arg 0, along
   // with the value of parameter "x" stored in arg 1, into stfld.
   ctorIL->Emit( OpCodes::Ldarg_0 );
   ctorIL->Emit( OpCodes::Ldarg_1 );
   ctorIL->Emit( OpCodes::Stfld, xField );
   
   // Now, we store arg 2 "y" in the current instance with stfld.
   ctorIL->Emit( OpCodes::Ldarg_0 );
   ctorIL->Emit( OpCodes::Ldarg_2 );
   ctorIL->Emit( OpCodes::Stfld, yField );
   
   // Last of all, arg 3 "z" gets stored in the current instance.
   ctorIL->Emit( OpCodes::Ldarg_0 );
   ctorIL->Emit( OpCodes::Ldarg_3 );
   ctorIL->Emit( OpCodes::Stfld, zField );
   
   // Our work complete, we return.
   ctorIL->Emit( OpCodes::Ret );
   
   // Now, let's create three very simple methods so we can see our fields.
   array<String^>^temp1 = {"GetX","GetY","GetZ"};
   array<String^>^mthdNames = temp1;
   System::Collections::IEnumerator^ myEnum = mthdNames->GetEnumerator();
   while ( myEnum->MoveNext() )
   {
      String^ mthdName = safe_cast<String^>(myEnum->Current);
      MethodBuilder^ getFieldMthd = pointTypeBld->DefineMethod( mthdName, MethodAttributes::Public, int::typeid, nullptr );
      ILGenerator^ mthdIL = getFieldMthd->GetILGenerator();
      mthdIL->Emit( OpCodes::Ldarg_0 );
      if ( mthdName->Equals( "GetX" ) )
            mthdIL->Emit( OpCodes::Ldfld, xField );
      else
      if ( mthdName->Equals( "GetY" ) )
            mthdIL->Emit( OpCodes::Ldfld, yField );
      else
      if ( mthdName->Equals( "GetZ" ) )
            mthdIL->Emit( OpCodes::Ldfld, zField );



      mthdIL->Emit( OpCodes::Ret );
   }

   pointType = pointTypeBld->CreateType();
   
   // Let's save it, just for posterity.
   myAsmBuilder->Save( "Point.dll" );
   return pointType;
}

int main()
{
   Type^ myDynamicType = nullptr;
   Object^ aPoint = nullptr;
   array<Type^>^temp2 = {int::typeid,int::typeid,int::typeid};
   array<Type^>^aPtypes = temp2;
   array<Object^>^temp3 = {4,5,6};
   array<Object^>^aPargs = temp3;
   
   // Call the  method to build our dynamic class.
   myDynamicType = DynamicPointTypeGen();
   Console::WriteLine( "Some information about my new Type '{0}':", myDynamicType->FullName );
   Console::WriteLine( "Assembly: '{0}'", myDynamicType->Assembly );
   Console::WriteLine( "Attributes: '{0}'", myDynamicType->Attributes );
   Console::WriteLine( "Module: '{0}'", myDynamicType->Module );
   Console::WriteLine( "Members: " );
   System::Collections::IEnumerator^ myEnum = myDynamicType->GetMembers()->GetEnumerator();
   while ( myEnum->MoveNext() )
   {
      MemberInfo^ member = safe_cast<MemberInfo^>(myEnum->Current);
      Console::WriteLine( "-- {0} {1};", member->MemberType, member->Name );
   }

   Console::WriteLine( "---" );
   
   // Let's take a look at the constructor we created.
   ConstructorInfo^ myDTctor = myDynamicType->GetConstructor( aPtypes );
   Console::WriteLine( "Constructor: {0};", myDTctor );
   Console::WriteLine( "---" );
   
   // Now, we get to use our dynamically-created class by invoking the constructor.
   aPoint = myDTctor->Invoke( aPargs );
   Console::WriteLine( "aPoint is type {0}.", aPoint->GetType() );
   
   // Finally, let's reflect on the instance of our new type - aPoint - and
   // make sure everything proceeded according to plan.
   Console::WriteLine( "aPoint.x = {0}", myDynamicType->InvokeMember( "GetX", BindingFlags::InvokeMethod, nullptr, aPoint, gcnew array<Object^>(0) ) );
   Console::WriteLine( "aPoint.y = {0}", myDynamicType->InvokeMember( "GetY", BindingFlags::InvokeMethod, nullptr, aPoint, gcnew array<Object^>(0) ) );
   Console::WriteLine( "aPoint.z = {0}", myDynamicType->InvokeMember( "GetZ", BindingFlags::InvokeMethod, nullptr, aPoint, gcnew array<Object^>(0) ) );
   
   // +++ OUTPUT +++
   // Some information about my new Type 'Point':
   // Assembly: 'MyDynamicAssembly, Version=0.0.0.0'
   // Attributes: 'AutoLayout, AnsiClass, NotPublic, Public'
   // Module: 'PointModule'
   // Members:
   // -- Field x;
   // -- Field y;
   // -- Field z;
   // -- Method GetHashCode;
   // -- Method Equals;
   // -- Method ToString;
   // -- Method GetType;
   // -- Constructor .ctor;
   // ---
   // Constructor: Void .ctor(Int32, Int32, Int32);
   // ---
   // aPoint is type Point.
   // aPoint.x = 4
   // aPoint.y = 5
   // aPoint.z = 6
}


using System;
using System.Threading;
using System.Reflection;
using System.Reflection.Emit;

class TestCtorBuilder {
 
  	public static Type DynamicPointTypeGen() {
	  
	   Type pointType = null;
	   Type[] ctorParams = new Type[] {typeof(int),
					    typeof(int),
					    typeof(int)};
 	
	   AppDomain myDomain = Thread.GetDomain();
	   AssemblyName myAsmName = new AssemblyName();
	   myAsmName.Name = "MyDynamicAssembly";
	
	   AssemblyBuilder myAsmBuilder = myDomain.DefineDynamicAssembly(
					  myAsmName, 
					  AssemblyBuilderAccess.RunAndSave);

   	   ModuleBuilder pointModule = myAsmBuilder.DefineDynamicModule("PointModule",
									"Point.dll");

	   TypeBuilder pointTypeBld = pointModule.DefineType("Point",
						              TypeAttributes.Public);

	   FieldBuilder xField = pointTypeBld.DefineField("x", typeof(int),
                                                          FieldAttributes.Public);
	   FieldBuilder yField = pointTypeBld.DefineField("y", typeof(int), 
                                                          FieldAttributes.Public);
	   FieldBuilder zField = pointTypeBld.DefineField("z", typeof(int),
                                                          FieldAttributes.Public);


           Type objType = Type.GetType("System.Object"); 
           ConstructorInfo objCtor = objType.GetConstructor(new Type[0]);

	   ConstructorBuilder pointCtor = pointTypeBld.DefineConstructor(
					  MethodAttributes.Public,
					  CallingConventions.Standard,
					  ctorParams);
	   ILGenerator ctorIL = pointCtor.GetILGenerator();

	   // NOTE: ldarg.0 holds the "this" reference - ldarg.1, ldarg.2, and ldarg.3
	   // hold the actual passed parameters. ldarg.0 is used by instance methods
	   // to hold a reference to the current calling object instance. Static methods
	   // do not use arg.0, since they are not instantiated and hence no reference
	   // is needed to distinguish them. 

           ctorIL.Emit(OpCodes.Ldarg_0);

	   // Here, we wish to create an instance of System.Object by invoking its
  	   // constructor, as specified above.

           ctorIL.Emit(OpCodes.Call, objCtor);

	   // Now, we'll load the current instance ref in arg 0, along
	   // with the value of parameter "x" stored in arg 1, into stfld.

           ctorIL.Emit(OpCodes.Ldarg_0);
           ctorIL.Emit(OpCodes.Ldarg_1);
           ctorIL.Emit(OpCodes.Stfld, xField); 

	   // Now, we store arg 2 "y" in the current instance with stfld.

           ctorIL.Emit(OpCodes.Ldarg_0);
           ctorIL.Emit(OpCodes.Ldarg_2);
           ctorIL.Emit(OpCodes.Stfld, yField); 

	   // Last of all, arg 3 "z" gets stored in the current instance.

           ctorIL.Emit(OpCodes.Ldarg_0);
           ctorIL.Emit(OpCodes.Ldarg_3);
           ctorIL.Emit(OpCodes.Stfld, zField); 
           
           // Our work complete, we return.

	   ctorIL.Emit(OpCodes.Ret); 

	   // Now, let's create three very simple methods so we can see our fields.

	   string[] mthdNames = new string[] {"GetX", "GetY", "GetZ"}; 

           foreach (string mthdName in mthdNames) {
              MethodBuilder getFieldMthd = pointTypeBld.DefineMethod(
				           mthdName, 
				           MethodAttributes.Public,
                                           typeof(int), 
                                           null);
	      ILGenerator mthdIL = getFieldMthd.GetILGenerator();
	   
	      mthdIL.Emit(OpCodes.Ldarg_0);
  	      switch (mthdName) {
	         case "GetX": mthdIL.Emit(OpCodes.Ldfld, xField);
			      break;
	         case "GetY": mthdIL.Emit(OpCodes.Ldfld, yField);
			      break;
	         case "GetZ": mthdIL.Emit(OpCodes.Ldfld, zField);
			      break;

	      }
	      mthdIL.Emit(OpCodes.Ret);

           }
	   // Finally, we create the type.

 	   pointType = pointTypeBld.CreateType();

	   // Let's save it, just for posterity.
	   
	   myAsmBuilder.Save("Point.dll");
	
	   return pointType;

 	}

	public static void Main() {
	
	   Type myDynamicType = null;
           object aPoint = null;
	   Type[] aPtypes = new Type[] {typeof(int), typeof(int), typeof(int)};
           object[] aPargs = new object[] {4, 5, 6};
	
	   // Call the  method to build our dynamic class.

	   myDynamicType = DynamicPointTypeGen();

	   Console.WriteLine("Some information about my new Type '{0}':",
			      myDynamicType.FullName);
	   Console.WriteLine("Assembly: '{0}'", myDynamicType.Assembly);
	   Console.WriteLine("Attributes: '{0}'", myDynamicType.Attributes);
	   Console.WriteLine("Module: '{0}'", myDynamicType.Module);
	   Console.WriteLine("Members: "); 
	   foreach (MemberInfo member in myDynamicType.GetMembers()) {
		Console.WriteLine("-- {0} {1};", member.MemberType, member.Name);
	   }

           Console.WriteLine("---");

	   // Let's take a look at the constructor we created.

	   ConstructorInfo myDTctor = myDynamicType.GetConstructor(aPtypes);
           Console.WriteLine("Constructor: {0};", myDTctor.ToString());

           Console.WriteLine("---");
	  
           // Now, we get to use our dynamically-created class by invoking the constructor. 

	   aPoint = myDTctor.Invoke(aPargs);
           Console.WriteLine("aPoint is type {0}.", aPoint.GetType());
	   	   

	   // Finally, let's reflect on the instance of our new type - aPoint - and
	   // make sure everything proceeded according to plan.

	   Console.WriteLine("aPoint.x = {0}",
			     myDynamicType.InvokeMember("GetX",
						        BindingFlags.InvokeMethod,
							null,
							aPoint,
							new object[0]));
	   Console.WriteLine("aPoint.y = {0}",
			     myDynamicType.InvokeMember("GetY",
						        BindingFlags.InvokeMethod,
							null,
							aPoint,
							new object[0]));
	   Console.WriteLine("aPoint.z = {0}",
			     myDynamicType.InvokeMember("GetZ",
						        BindingFlags.InvokeMethod,
							null,
							aPoint,
							new object[0]));

	    

	   // +++ OUTPUT +++
	   // Some information about my new Type 'Point':
	   // Assembly: 'MyDynamicAssembly, Version=0.0.0.0'
	   // Attributes: 'AutoLayout, AnsiClass, NotPublic, Public'
	   // Module: 'PointModule'
	   // Members: 
	   // -- Field x;
	   // -- Field y;
	   // -- Field z;
           // -- Method GetHashCode;
           // -- Method Equals;
           // -- Method ToString;
           // -- Method GetType;
           // -- Constructor .ctor;
	   // ---
	   // Constructor: Void .ctor(Int32, Int32, Int32);
	   // ---
	   // aPoint is type Point.
	   // aPoint.x = 4
	   // aPoint.y = 5
	   // aPoint.z = 6
	    
	}
    
}


Imports System
Imports System.Threading
Imports System.Reflection
Imports System.Reflection.Emit

 _

Class TestCtorBuilder
   
   
   Public Shared Function DynamicPointTypeGen() As Type
      
      Dim pointType As Type = Nothing
      Dim ctorParams() As Type = {GetType(Integer), GetType(Integer), GetType(Integer)}
      
      Dim myDomain As AppDomain = Thread.GetDomain()
      Dim myAsmName As New AssemblyName()
      myAsmName.Name = "MyDynamicAssembly"
      
      Dim myAsmBuilder As AssemblyBuilder = myDomain.DefineDynamicAssembly(myAsmName, AssemblyBuilderAccess.RunAndSave)
      
      Dim pointModule As ModuleBuilder = myAsmBuilder.DefineDynamicModule("PointModule", "Point.dll")
      
      Dim pointTypeBld As TypeBuilder = pointModule.DefineType("Point", TypeAttributes.Public)
      
      Dim xField As FieldBuilder = pointTypeBld.DefineField("x", GetType(Integer), FieldAttributes.Public)
      Dim yField As FieldBuilder = pointTypeBld.DefineField("y", GetType(Integer), FieldAttributes.Public)
      Dim zField As FieldBuilder = pointTypeBld.DefineField("z", GetType(Integer), FieldAttributes.Public)
      
      Dim objType As Type = Type.GetType("System.Object")
      Dim objCtor As ConstructorInfo = objType.GetConstructor(New Type() {})
      
      Dim pointCtor As ConstructorBuilder = pointTypeBld.DefineConstructor(MethodAttributes.Public, CallingConventions.Standard, ctorParams)
      Dim ctorIL As ILGenerator = pointCtor.GetILGenerator()
      
      ' NOTE: ldarg.0 holds the "this" reference - ldarg.1, ldarg.2, and ldarg.3
      ' hold the actual passed parameters. ldarg.0 is used by instance methods
      ' to hold a reference to the current calling object instance. Static methods
      ' do not use arg.0, since they are not instantiated and hence no reference
      ' is needed to distinguish them. 
      ctorIL.Emit(OpCodes.Ldarg_0)
      
      ' Here, we wish to create an instance of System.Object by invoking its
      ' constructor, as specified above.
      ctorIL.Emit(OpCodes.Call, objCtor)
      
      ' Now, we'll load the current instance ref in arg 0, along
      ' with the value of parameter "x" stored in arg 1, into stfld.
      ctorIL.Emit(OpCodes.Ldarg_0)
      ctorIL.Emit(OpCodes.Ldarg_1)
      ctorIL.Emit(OpCodes.Stfld, xField)
      
      ' Now, we store arg 2 "y" in the current instance with stfld.
      ctorIL.Emit(OpCodes.Ldarg_0)
      ctorIL.Emit(OpCodes.Ldarg_2)
      ctorIL.Emit(OpCodes.Stfld, yField)
      
      ' Last of all, arg 3 "z" gets stored in the current instance.
      ctorIL.Emit(OpCodes.Ldarg_0)
      ctorIL.Emit(OpCodes.Ldarg_3)
      ctorIL.Emit(OpCodes.Stfld, zField)
      
      ' Our work complete, we return.
      ctorIL.Emit(OpCodes.Ret)
      
      ' Now, let's create three very simple methods so we can see our fields.
      Dim mthdNames() As String = {"GetX", "GetY", "GetZ"}
      
      Dim mthdName As String
      For Each mthdName In  mthdNames
         Dim getFieldMthd As MethodBuilder = pointTypeBld.DefineMethod(mthdName, MethodAttributes.Public, GetType(Integer), Nothing)
         Dim mthdIL As ILGenerator = getFieldMthd.GetILGenerator()
         
         mthdIL.Emit(OpCodes.Ldarg_0)
         Select Case mthdName
            Case "GetX"
               mthdIL.Emit(OpCodes.Ldfld, xField)
            Case "GetY"
               mthdIL.Emit(OpCodes.Ldfld, yField)
            Case "GetZ"
               mthdIL.Emit(OpCodes.Ldfld, zField)
         End Select
         
         mthdIL.Emit(OpCodes.Ret)
      Next mthdName 
      ' Finally, we create the type.
      pointType = pointTypeBld.CreateType()
      
      ' Let's save it, just for posterity.
      myAsmBuilder.Save("Point.dll")
      
      Return pointType
   End Function 'DynamicPointTypeGen
    
   
   Public Shared Sub Main()
      
      Dim myDynamicType As Type = Nothing
      Dim aPoint As Object = Nothing
      Dim aPtypes() As Type = {GetType(Integer), GetType(Integer), GetType(Integer)}
      Dim aPargs() As Object = {4, 5, 6}
      
      ' Call the  method to build our dynamic class.
      myDynamicType = DynamicPointTypeGen()
      
      Console.WriteLine("Some information about my new Type '{0}':", myDynamicType.FullName)
      Console.WriteLine("Assembly: '{0}'", myDynamicType.Assembly)
      Console.WriteLine("Attributes: '{0}'", myDynamicType.Attributes)
      Console.WriteLine("Module: '{0}'", myDynamicType.Module)
      Console.WriteLine("Members: ")
      Dim member As MemberInfo
      For Each member In  myDynamicType.GetMembers()
         Console.WriteLine("-- {0} {1};", member.MemberType, member.Name)
      Next member
      
      Console.WriteLine("---")
      
      ' Let's take a look at the constructor we created.
      Dim myDTctor As ConstructorInfo = myDynamicType.GetConstructor(aPtypes)
      Console.WriteLine("Constructor: {0};", myDTctor.ToString())
      
      Console.WriteLine("---")
      
      ' Now, we get to use our dynamically-created class by invoking the constructor. 
      aPoint = myDTctor.Invoke(aPargs)
      Console.WriteLine("aPoint is type {0}.", aPoint.GetType())
      
      
      ' Finally, let's reflect on the instance of our new type - aPoint - and
      ' make sure everything proceeded according to plan.
      Console.WriteLine("aPoint.x = {0}", myDynamicType.InvokeMember("GetX", BindingFlags.InvokeMethod, Nothing, aPoint, New Object() {}))
      Console.WriteLine("aPoint.y = {0}", myDynamicType.InvokeMember("GetY", BindingFlags.InvokeMethod, Nothing, aPoint, New Object() {}))
      Console.WriteLine("aPoint.z = {0}", myDynamicType.InvokeMember("GetZ", BindingFlags.InvokeMethod, Nothing, aPoint, New Object() {}))
   End Sub 'Main
End Class 'TestCtorBuilder



' +++ OUTPUT +++
' Some information about my new Type 'Point':
' Assembly: 'MyDynamicAssembly, Version=0.0.0.0'
' Attributes: 'AutoLayout, AnsiClass, NotPublic, Public'
' Module: 'PointModule'
' Members: 
' -- Field x;
' -- Field y;
' -- Field z;
' -- Method GetHashCode;
' -- Method Equals;
' -- Method ToString;
' -- Method GetType;
' -- Constructor .ctor;
' ---
' Constructor: Void .ctor(Int32, Int32, Int32);
' ---
' aPoint is type Point.
' aPoint.x = 4
' aPoint.y = 5
' aPoint.z = 6

Comentarios

ConstructorBuilder se usa para describir completamente un constructor en lenguaje intermedio de Microsoft (MSIL), incluidos el nombre, atributos, firma y cuerpo del constructor.ConstructorBuilder is used to fully describe a constructor in Microsoft intermediate language (MSIL), including the name, attributes, signature, and constructor body. Se usa junto con el TypeBuilder clase para crear clases en tiempo de ejecución.It is used in conjunction with the TypeBuilder class to create classes at run time. Llame a DefineConstructor para obtener una instancia de ConstructorBuilder.Call DefineConstructor to get an instance of ConstructorBuilder.

Si no define un constructor para su tipo dinámico, se proporciona automáticamente un constructor predeterminado y llama al constructor predeterminado de la clase base.If you do not define a constructor for your dynamic type, a default constructor is provided automatically, and it calls the default constructor of the base class.

Si usa ConstructorBuilder para definir un constructor para su tipo dinámico, no se proporciona un constructor predeterminado.If you use ConstructorBuilder to define a constructor for your dynamic type, a default constructor is not provided. Tiene las siguientes opciones para proporcionar un constructor predeterminado además del constructor definido:You have the following options for providing a default constructor in addition to the constructor you defined:

  • Si desea que un constructor predeterminado que llame simplemente al constructor predeterminado de la clase base, puede usar el TypeBuilder.DefineDefaultConstructor método para crear uno (y, opcionalmente, restringir el acceso a él).If you want a default constructor that simply calls the default constructor of the base class, you can use the TypeBuilder.DefineDefaultConstructor method to create one (and optionally restrict access to it). Proporciona una implementación para este constructor predeterminado.Do not provide an implementation for this default constructor. Si lo hace, se produce una excepción al intentar usar el constructor.If you do, an exception is thrown when you try to use the constructor. Se produce ninguna excepción cuando la TypeBuilder.CreateType se llama al método.No exception is thrown when the TypeBuilder.CreateType method is called.

  • Si desea que un constructor predeterminado que haga algo más que simplemente llamar el constructor predeterminado de la clase base, o que llama a otro constructor de la clase base o que haga algo completamente distinto, debe usar el TypeBuilder.DefineConstructor método para crear un ConstructorBuildery proporcionar su propia implementación.If you want a default constructor that does something more than simply calling the default constructor of the base class, or that calls another constructor of the base class, or that does something else entirely, you must use the TypeBuilder.DefineConstructor method to create a ConstructorBuilder, and provide your own implementation.

Propiedades

Attributes Attributes Attributes Attributes

Obtiene los atributos de este constructor.Gets the attributes for this constructor.

CallingConvention CallingConvention CallingConvention CallingConvention

Obtiene un valor de CallingConventions que depende de que el tipo declarativo sea genérico.Gets a CallingConventions value that depends on whether the declaring type is generic.

ContainsGenericParameters ContainsGenericParameters ContainsGenericParameters 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.

(Inherited from MethodBase)
CustomAttributes CustomAttributes CustomAttributes CustomAttributes

Obtiene una colección que contiene los atributos personalizados de este miembro.Gets a collection that contains this member's custom attributes.

(Inherited from MemberInfo)
DeclaringType DeclaringType DeclaringType DeclaringType

Obtiene una referencia al objeto Type para el tipo que declara este miembro.Gets a reference to the Type object for the type that declares this member.

InitLocals InitLocals InitLocals InitLocals

Obtiene o establece si las variables locales de este constructor deben inicializarse en cero.Gets or sets whether the local variables in this constructor should be zero-initialized.

IsAbstract IsAbstract IsAbstract IsAbstract

Obtiene un valor que indica si el método es abstracto.Gets a value indicating whether the method is abstract.

(Inherited from MethodBase)
IsAssembly IsAssembly IsAssembly 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.

(Inherited from MethodBase)
IsCollectible IsCollectible IsCollectible 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.

(Inherited from MemberInfo)
IsConstructedGenericMethod IsConstructedGenericMethod IsConstructedGenericMethod IsConstructedGenericMethod Inherited from MethodBase
IsConstructor IsConstructor IsConstructor IsConstructor

Obtiene un valor que indica si el método es un constructor.Gets a value indicating whether the method is a constructor.

(Inherited from MethodBase)
IsFamily IsFamily IsFamily 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.

(Inherited from MethodBase)
IsFamilyAndAssembly IsFamilyAndAssembly IsFamilyAndAssembly 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.

(Inherited from MethodBase)
IsFamilyOrAssembly IsFamilyOrAssembly IsFamilyOrAssembly 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.

(Inherited from MethodBase)
IsFinal IsFinal IsFinal IsFinal

Obtiene un valor que indica si este método es final.Gets a value indicating whether this method is final.

(Inherited from MethodBase)
IsGenericMethod IsGenericMethod IsGenericMethod IsGenericMethod

Obtiene un valor que indica si el método es genérico.Gets a value indicating whether the method is generic.

(Inherited from MethodBase)
IsGenericMethodDefinition IsGenericMethodDefinition IsGenericMethodDefinition 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.

(Inherited from MethodBase)
IsHideBySig IsHideBySig IsHideBySig 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.

(Inherited from MethodBase)
IsPrivate IsPrivate IsPrivate IsPrivate

Obtiene un valor que indica si este miembro es privado.Gets a value indicating whether this member is private.

(Inherited from MethodBase)
IsPublic IsPublic IsPublic IsPublic

Obtiene un valor que indica si éste es un método público.Gets a value indicating whether this is a public method.

(Inherited from MethodBase)
IsSecurityCritical IsSecurityCritical IsSecurityCritical 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.

(Inherited from MethodBase)
IsSecuritySafeCritical IsSecuritySafeCritical IsSecuritySafeCritical 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.

(Inherited from MethodBase)
IsSecurityTransparent IsSecurityTransparent IsSecurityTransparent 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.

(Inherited from MethodBase)
IsSpecialName IsSpecialName IsSpecialName 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.

(Inherited from MethodBase)
IsStatic IsStatic IsStatic IsStatic

Obtiene un valor que indica si el método es static.Gets a value indicating whether the method is static.

(Inherited from MethodBase)
IsVirtual IsVirtual IsVirtual IsVirtual

Obtiene un valor que indica si el método es virtual.Gets a value indicating whether the method is virtual.

(Inherited from MethodBase)
MemberType MemberType MemberType MemberType

Obtiene un valor de MemberTypes que indica que este miembro es un constructor.Gets a MemberTypes value indicating that this member is a constructor.

(Inherited from ConstructorInfo)
MetadataToken MetadataToken MetadataToken MetadataToken

Obtiene un valor que identifica un elemento de metadatos.Gets a value that identifies a metadata element.

(Inherited from MemberInfo)
MethodHandle MethodHandle MethodHandle MethodHandle

Obtiene el identificador interno para el método.Gets the internal handle for the method. Utilice este identificador para tener acceso al identificador de metadatos subyacente.Use this handle to access the underlying metadata handle.

MethodImplementationFlags MethodImplementationFlags MethodImplementationFlags 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 Module Module Module

Obtiene el módulo dinámico en el que se define este constructor.Gets the dynamic module in which this constructor is defined.

Name Name Name Name

Recupera el nombre de este constructor.Retrieves the name of this constructor.

ReflectedType ReflectedType ReflectedType ReflectedType

Contiene una referencia al objeto Type a partir de la cual se obtuvo el objeto en cuestión.Holds a reference to the Type object from which this object was obtained.

ReturnType ReturnType ReturnType ReturnType

Obtiene null.Gets null.

Signature Signature Signature Signature

Recupera la firma del campo en formato de cadena.Retrieves the signature of the field in the form of a string.

_MethodBase.IsAbstract _MethodBase.IsAbstract _MethodBase.IsAbstract _MethodBase.IsAbstract

Para obtener una descripción de este miembro, vea IsAbstract.For a description of this member, see IsAbstract.

(Inherited from MethodBase)
_MethodBase.IsAssembly _MethodBase.IsAssembly _MethodBase.IsAssembly _MethodBase.IsAssembly

Para obtener una descripción de este miembro, vea IsAssembly.For a description of this member, see IsAssembly.

(Inherited from MethodBase)
_MethodBase.IsConstructor _MethodBase.IsConstructor _MethodBase.IsConstructor _MethodBase.IsConstructor

Para obtener una descripción de este miembro, vea IsConstructor.For a description of this member, see IsConstructor.

(Inherited from MethodBase)
_MethodBase.IsFamily _MethodBase.IsFamily _MethodBase.IsFamily _MethodBase.IsFamily

Para obtener una descripción de este miembro, vea IsFamily.For a description of this member, see IsFamily.

(Inherited from MethodBase)
_MethodBase.IsFamilyAndAssembly _MethodBase.IsFamilyAndAssembly _MethodBase.IsFamilyAndAssembly _MethodBase.IsFamilyAndAssembly

Para obtener una descripción de este miembro, vea IsFamilyAndAssembly.For a description of this member, see IsFamilyAndAssembly.

(Inherited from MethodBase)
_MethodBase.IsFamilyOrAssembly _MethodBase.IsFamilyOrAssembly _MethodBase.IsFamilyOrAssembly _MethodBase.IsFamilyOrAssembly

Para obtener una descripción de este miembro, vea IsFamilyOrAssembly.For a description of this member, see IsFamilyOrAssembly.

(Inherited from MethodBase)
_MethodBase.IsFinal _MethodBase.IsFinal _MethodBase.IsFinal _MethodBase.IsFinal

Para obtener una descripción de este miembro, vea IsFinal.For a description of this member, see IsFinal.

(Inherited from MethodBase)
_MethodBase.IsHideBySig _MethodBase.IsHideBySig _MethodBase.IsHideBySig _MethodBase.IsHideBySig

Para obtener una descripción de este miembro, vea IsHideBySig.For a description of this member, see IsHideBySig.

(Inherited from MethodBase)
_MethodBase.IsPrivate _MethodBase.IsPrivate _MethodBase.IsPrivate _MethodBase.IsPrivate

Para obtener una descripción de este miembro, vea IsPrivate.For a description of this member, see IsPrivate.

(Inherited from MethodBase)
_MethodBase.IsPublic _MethodBase.IsPublic _MethodBase.IsPublic _MethodBase.IsPublic

Para obtener una descripción de este miembro, vea IsPublic.For a description of this member, see IsPublic.

(Inherited from MethodBase)
_MethodBase.IsSpecialName _MethodBase.IsSpecialName _MethodBase.IsSpecialName _MethodBase.IsSpecialName

Para obtener una descripción de este miembro, vea IsSpecialName.For a description of this member, see IsSpecialName.

(Inherited from MethodBase)
_MethodBase.IsStatic _MethodBase.IsStatic _MethodBase.IsStatic _MethodBase.IsStatic

Para obtener una descripción de este miembro, vea IsStatic.For a description of this member, see IsStatic.

(Inherited from MethodBase)
_MethodBase.IsVirtual _MethodBase.IsVirtual _MethodBase.IsVirtual _MethodBase.IsVirtual

Para obtener una descripción de este miembro, vea IsVirtual.For a description of this member, see IsVirtual.

(Inherited from MethodBase)

Métodos

AddDeclarativeSecurity(SecurityAction, PermissionSet) AddDeclarativeSecurity(SecurityAction, PermissionSet) AddDeclarativeSecurity(SecurityAction, PermissionSet) AddDeclarativeSecurity(SecurityAction, PermissionSet)

Agrega seguridad declarativa a este constructor.Adds declarative security to this constructor.

DefineParameter(Int32, ParameterAttributes, String) DefineParameter(Int32, ParameterAttributes, String) DefineParameter(Int32, ParameterAttributes, String) DefineParameter(Int32, ParameterAttributes, String)

Define un parámetro de este constructor.Defines a parameter of this constructor.

Equals(Object) Equals(Object) Equals(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.

(Inherited from ConstructorInfo)
GetCustomAttributes(Boolean) GetCustomAttributes(Boolean) GetCustomAttributes(Boolean) GetCustomAttributes(Boolean)

Devuelve todos los atributos personalizados definidos para este constructor.Returns all the custom attributes defined for this constructor.

GetCustomAttributes(Type, Boolean) GetCustomAttributes(Type, Boolean) GetCustomAttributes(Type, Boolean) GetCustomAttributes(Type, Boolean)

Devuelve los atributos personalizados identificados por el tipo dado.Returns the custom attributes identified by the given type.

GetCustomAttributesData() GetCustomAttributesData() GetCustomAttributesData() 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.

(Inherited from MemberInfo)
GetGenericArguments() GetGenericArguments() GetGenericArguments() 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.

(Inherited from MethodBase)
GetHashCode() GetHashCode() GetHashCode() GetHashCode()

Devuelve el código hash de esta instancia.Returns the hash code for this instance.

(Inherited from ConstructorInfo)
GetILGenerator() GetILGenerator() GetILGenerator() GetILGenerator()

Obtiene un objeto ILGenerator para este constructor.Gets an ILGenerator for this constructor.

GetILGenerator(Int32) GetILGenerator(Int32) GetILGenerator(Int32) GetILGenerator(Int32)

Obtiene un objeto ILGenerator, con el tamaño de la secuencia de MSIL especificado, que se puede utilizar para crear un cuerpo de método para este constructor.Gets an ILGenerator object, with the specified MSIL stream size, that can be used to build a method body for this constructor.

GetMethodBody() GetMethodBody() GetMethodBody() 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.

(Inherited from MethodBase)
GetMethodImplementationFlags() GetMethodImplementationFlags() GetMethodImplementationFlags() GetMethodImplementationFlags()

Devuelve las marcas de implementación de método de este constructor.Returns the method implementation flags for this constructor.

GetModule() GetModule() GetModule() GetModule()

Devuelve una referencia al módulo que contiene este constructor.Returns a reference to the module that contains this constructor.

GetParameters() GetParameters() GetParameters() GetParameters()

Devuelve los parámetros de este constructor.Returns the parameters of this constructor.

GetToken() GetToken() GetToken() GetToken()

Devuelve el MethodToken que representa al símbolo (token) de este constructor.Returns the MethodToken that represents the token for this constructor.

GetType() GetType() GetType() GetType() Inherited from ConstructorInfo
HasSameMetadataDefinitionAs(MemberInfo) HasSameMetadataDefinitionAs(MemberInfo) HasSameMetadataDefinitionAs(MemberInfo) HasSameMetadataDefinitionAs(MemberInfo) Inherited from MemberInfo
Invoke(BindingFlags, Binder, Object[], CultureInfo) Invoke(BindingFlags, Binder, Object[], CultureInfo) Invoke(BindingFlags, Binder, Object[], CultureInfo) Invoke(BindingFlags, Binder, Object[], CultureInfo)

Invoca dinámicamente al constructor representado por esta instancia en el objeto dado, pasando los parámetros especificados y considerando las restricciones del enlazador facilitado.Dynamically invokes the constructor represented by this instance on the given object, passing along the specified parameters, and under the constraints of the given binder.

Invoke(Object, BindingFlags, Binder, Object[], CultureInfo) Invoke(Object, BindingFlags, Binder, Object[], CultureInfo) Invoke(Object, BindingFlags, Binder, Object[], CultureInfo) Invoke(Object, BindingFlags, Binder, Object[], CultureInfo)

Se invoca dinámicamente al constructor reflejado por esta instancia con los argumentos especificados considerando las restricciones del Binder especificado.Dynamically invokes the constructor reflected by this instance with the specified arguments, under the constraints of the specified Binder.

Invoke(Object, Object[]) Invoke(Object, Object[]) Invoke(Object, Object[]) 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.

(Inherited from MethodBase)
Invoke(Object[]) Invoke(Object[]) Invoke(Object[]) Invoke(Object[])

Invoca al constructor reflejado por la instancia que tiene los parámetros especificados, proporcionando valores predeterminados para los parámetros que no se usan habitualmente.Invokes the constructor reflected by the instance that has the specified parameters, providing default values for the parameters not commonly used.

(Inherited from ConstructorInfo)
IsDefined(Type, Boolean) IsDefined(Type, Boolean) IsDefined(Type, Boolean) IsDefined(Type, Boolean)

Comprueba si se ha definido el tipo de atributo personalizado especificado.Checks if the specified custom attribute type is defined.

MemberwiseClone() MemberwiseClone() MemberwiseClone() MemberwiseClone()

Crea una copia superficial del objeto Object actual.Creates a shallow copy of the current Object.

(Inherited from Object)
SetCustomAttribute(ConstructorInfo, Byte[]) SetCustomAttribute(ConstructorInfo, Byte[]) SetCustomAttribute(ConstructorInfo, Byte[]) SetCustomAttribute(ConstructorInfo, Byte[])

Establezca un atributo personalizado mediante el objeto binario de atributo personalizado especificado.Set a custom attribute using a specified custom attribute blob.

SetCustomAttribute(CustomAttributeBuilder) SetCustomAttribute(CustomAttributeBuilder) SetCustomAttribute(CustomAttributeBuilder) SetCustomAttribute(CustomAttributeBuilder)

Establece un atributo personalizado mediante un generador de atributos personalizado.Set a custom attribute using a custom attribute builder.

SetImplementationFlags(MethodImplAttributes) SetImplementationFlags(MethodImplAttributes) SetImplementationFlags(MethodImplAttributes) SetImplementationFlags(MethodImplAttributes)

Establece las marcas de implementación de métodos para este constructor.Sets the method implementation flags for this constructor.

SetMethodBody(Byte[], Int32, Byte[], IEnumerable<ExceptionHandler>, IEnumerable<Int32>) SetMethodBody(Byte[], Int32, Byte[], IEnumerable<ExceptionHandler>, IEnumerable<Int32>) SetMethodBody(Byte[], Int32, Byte[], IEnumerable<ExceptionHandler>, IEnumerable<Int32>) SetMethodBody(Byte[], Int32, Byte[], IEnumerable<ExceptionHandler>, IEnumerable<Int32>)

Crea el cuerpo del constructor mediante una matriz de bytes especificada de las instrucciones del Lenguaje intermedio de Microsoft (MSIL).Creates the body of the constructor by using a specified byte array of Microsoft intermediate language (MSIL) instructions.

SetSymCustomAttribute(String, Byte[]) SetSymCustomAttribute(String, Byte[]) SetSymCustomAttribute(String, Byte[]) SetSymCustomAttribute(String, Byte[])

Establece el atributo personalizado de este constructor asociado a información simbólica.Sets this constructor's custom attribute associated with symbolic information.

ToString() ToString() ToString() ToString()

Devuelve la instancia ConstructorBuilder como String.Returns this ConstructorBuilder instance as a String.

Implementaciones de interfaz explícitas

ICustomAttributeProvider.GetCustomAttributes(Boolean) ICustomAttributeProvider.GetCustomAttributes(Boolean) ICustomAttributeProvider.GetCustomAttributes(Boolean) ICustomAttributeProvider.GetCustomAttributes(Boolean) Inherited from MemberInfo
ICustomAttributeProvider.GetCustomAttributes(Type, Boolean) ICustomAttributeProvider.GetCustomAttributes(Type, Boolean) ICustomAttributeProvider.GetCustomAttributes(Type, Boolean) ICustomAttributeProvider.GetCustomAttributes(Type, Boolean) Inherited from MemberInfo
ICustomAttributeProvider.IsDefined(Type, Boolean) ICustomAttributeProvider.IsDefined(Type, Boolean) ICustomAttributeProvider.IsDefined(Type, Boolean) ICustomAttributeProvider.IsDefined(Type, Boolean) Inherited from MemberInfo
_ConstructorBuilder.GetIDsOfNames(Guid, IntPtr, UInt32, UInt32, IntPtr) _ConstructorBuilder.GetIDsOfNames(Guid, IntPtr, UInt32, UInt32, IntPtr) _ConstructorBuilder.GetIDsOfNames(Guid, IntPtr, UInt32, UInt32, IntPtr) _ConstructorBuilder.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.

_ConstructorBuilder.GetTypeInfo(UInt32, UInt32, IntPtr) _ConstructorBuilder.GetTypeInfo(UInt32, UInt32, IntPtr) _ConstructorBuilder.GetTypeInfo(UInt32, UInt32, IntPtr) _ConstructorBuilder.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.

_ConstructorBuilder.GetTypeInfoCount(UInt32) _ConstructorBuilder.GetTypeInfoCount(UInt32) _ConstructorBuilder.GetTypeInfoCount(UInt32) _ConstructorBuilder.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).

_ConstructorBuilder.Invoke(UInt32, Guid, UInt32, Int16, IntPtr, IntPtr, IntPtr, IntPtr) _ConstructorBuilder.Invoke(UInt32, Guid, UInt32, Int16, IntPtr, IntPtr, IntPtr, IntPtr) _ConstructorBuilder.Invoke(UInt32, Guid, UInt32, Int16, IntPtr, IntPtr, IntPtr, IntPtr) _ConstructorBuilder.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.

_ConstructorInfo.GetIDsOfNames(Guid, IntPtr, UInt32, UInt32, IntPtr) _ConstructorInfo.GetIDsOfNames(Guid, IntPtr, UInt32, UInt32, IntPtr) _ConstructorInfo.GetIDsOfNames(Guid, IntPtr, UInt32, UInt32, IntPtr) _ConstructorInfo.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.

(Inherited from ConstructorInfo)
_ConstructorInfo.GetType() _ConstructorInfo.GetType() _ConstructorInfo.GetType() _ConstructorInfo.GetType()

Obtiene un objeto Type que representa el tipo de ConstructorInfo.Gets a Type object representing the ConstructorInfo type.

(Inherited from ConstructorInfo)
_ConstructorInfo.GetTypeInfo(UInt32, UInt32, IntPtr) _ConstructorInfo.GetTypeInfo(UInt32, UInt32, IntPtr) _ConstructorInfo.GetTypeInfo(UInt32, UInt32, IntPtr) _ConstructorInfo.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.

(Inherited from ConstructorInfo)
_ConstructorInfo.GetTypeInfoCount(UInt32) _ConstructorInfo.GetTypeInfoCount(UInt32) _ConstructorInfo.GetTypeInfoCount(UInt32) _ConstructorInfo.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).

(Inherited from ConstructorInfo)
_ConstructorInfo.Invoke(UInt32, Guid, UInt32, Int16, IntPtr, IntPtr, IntPtr, IntPtr) _ConstructorInfo.Invoke(UInt32, Guid, UInt32, Int16, IntPtr, IntPtr, IntPtr, IntPtr) _ConstructorInfo.Invoke(UInt32, Guid, UInt32, Int16, IntPtr, IntPtr, IntPtr, IntPtr) _ConstructorInfo.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.

(Inherited from ConstructorInfo)
_ConstructorInfo.Invoke_2(Object, BindingFlags, Binder, Object[], CultureInfo) _ConstructorInfo.Invoke_2(Object, BindingFlags, Binder, Object[], CultureInfo) _ConstructorInfo.Invoke_2(Object, BindingFlags, Binder, Object[], CultureInfo) _ConstructorInfo.Invoke_2(Object, BindingFlags, Binder, Object[], CultureInfo)

Proporciona el acceso independiente de la versión de los objetos COM al método Invoke(Object, BindingFlags, Binder, Object[], CultureInfo).Provides COM objects with version-independent access to the Invoke(Object, BindingFlags, Binder, Object[], CultureInfo) method.

(Inherited from ConstructorInfo)
_ConstructorInfo.Invoke_3(Object, Object[]) _ConstructorInfo.Invoke_3(Object, Object[]) _ConstructorInfo.Invoke_3(Object, Object[]) _ConstructorInfo.Invoke_3(Object, Object[])

Proporciona el acceso independiente de la versión de los objetos COM al método Invoke(Object, Object[]).Provides COM objects with version-independent access to the Invoke(Object, Object[]) method.

(Inherited from ConstructorInfo)
_ConstructorInfo.Invoke_4(BindingFlags, Binder, Object[], CultureInfo) _ConstructorInfo.Invoke_4(BindingFlags, Binder, Object[], CultureInfo) _ConstructorInfo.Invoke_4(BindingFlags, Binder, Object[], CultureInfo) _ConstructorInfo.Invoke_4(BindingFlags, Binder, Object[], CultureInfo)

Proporciona el acceso independiente de la versión de los objetos COM al método Invoke(BindingFlags, Binder, Object[], CultureInfo).Provides COM objects with version-independent access to the Invoke(BindingFlags, Binder, Object[], CultureInfo) method.

(Inherited from ConstructorInfo)
_ConstructorInfo.Invoke_5(Object[]) _ConstructorInfo.Invoke_5(Object[]) _ConstructorInfo.Invoke_5(Object[]) _ConstructorInfo.Invoke_5(Object[])

Proporciona el acceso independiente de la versión de los objetos COM al método Invoke(Object[]).Provides COM objects with version-independent access to the Invoke(Object[]) method.

(Inherited from ConstructorInfo)
_MemberInfo.GetIDsOfNames(Guid, IntPtr, UInt32, UInt32, IntPtr) _MemberInfo.GetIDsOfNames(Guid, IntPtr, UInt32, UInt32, IntPtr) _MemberInfo.GetIDsOfNames(Guid, IntPtr, UInt32, UInt32, IntPtr) _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.

(Inherited from MemberInfo)
_MemberInfo.GetType() _MemberInfo.GetType() _MemberInfo.GetType() _MemberInfo.GetType()

Objeto Type que representa la clase MemberInfo.Gets a Type object representing the MemberInfo class.

(Inherited from MemberInfo)
_MemberInfo.GetTypeInfo(UInt32, UInt32, IntPtr) _MemberInfo.GetTypeInfo(UInt32, UInt32, IntPtr) _MemberInfo.GetTypeInfo(UInt32, UInt32, IntPtr) _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.

(Inherited from MemberInfo)
_MemberInfo.GetTypeInfoCount(UInt32) _MemberInfo.GetTypeInfoCount(UInt32) _MemberInfo.GetTypeInfoCount(UInt32) _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).

(Inherited from MemberInfo)
_MemberInfo.Invoke(UInt32, Guid, UInt32, Int16, IntPtr, IntPtr, IntPtr, IntPtr) _MemberInfo.Invoke(UInt32, Guid, UInt32, Int16, IntPtr, IntPtr, IntPtr, IntPtr) _MemberInfo.Invoke(UInt32, Guid, UInt32, Int16, IntPtr, IntPtr, IntPtr, IntPtr) _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.

(Inherited from MemberInfo)
_MethodBase.GetIDsOfNames(Guid, IntPtr, UInt32, UInt32, IntPtr) _MethodBase.GetIDsOfNames(Guid, IntPtr, UInt32, UInt32, IntPtr) _MethodBase.GetIDsOfNames(Guid, IntPtr, UInt32, UInt32, IntPtr) _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.

(Inherited from MethodBase)
_MethodBase.GetType() _MethodBase.GetType() _MethodBase.GetType() _MethodBase.GetType()

Para obtener una descripción de este miembro, vea GetType().For a description of this member, see GetType().

(Inherited from MethodBase)
_MethodBase.GetTypeInfo(UInt32, UInt32, IntPtr) _MethodBase.GetTypeInfo(UInt32, UInt32, IntPtr) _MethodBase.GetTypeInfo(UInt32, UInt32, IntPtr) _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.

(Inherited from MethodBase)
_MethodBase.GetTypeInfoCount(UInt32) _MethodBase.GetTypeInfoCount(UInt32) _MethodBase.GetTypeInfoCount(UInt32) _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).

(Inherited from MethodBase)
_MethodBase.Invoke(UInt32, Guid, UInt32, Int16, IntPtr, IntPtr, IntPtr, IntPtr) _MethodBase.Invoke(UInt32, Guid, UInt32, Int16, IntPtr, IntPtr, IntPtr, IntPtr) _MethodBase.Invoke(UInt32, Guid, UInt32, Int16, IntPtr, IntPtr, IntPtr, IntPtr) _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.

(Inherited from MethodBase)

Extension Methods

GetCustomAttribute(MemberInfo, Type) GetCustomAttribute(MemberInfo, Type) GetCustomAttribute(MemberInfo, Type) 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) GetCustomAttribute(MemberInfo, Type, Boolean) GetCustomAttribute(MemberInfo, Type, Boolean) 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) GetCustomAttribute<T>(MemberInfo) GetCustomAttribute<T>(MemberInfo) 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) GetCustomAttribute<T>(MemberInfo, Boolean) GetCustomAttribute<T>(MemberInfo, Boolean) 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) GetCustomAttributes(MemberInfo) GetCustomAttributes(MemberInfo) 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) GetCustomAttributes(MemberInfo, Boolean) GetCustomAttributes(MemberInfo, Boolean) 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) GetCustomAttributes(MemberInfo, Type) GetCustomAttributes(MemberInfo, Type) 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) GetCustomAttributes(MemberInfo, Type, Boolean) GetCustomAttributes(MemberInfo, Type, Boolean) 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) GetCustomAttributes<T>(MemberInfo) GetCustomAttributes<T>(MemberInfo) 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) GetCustomAttributes<T>(MemberInfo, Boolean) GetCustomAttributes<T>(MemberInfo, Boolean) 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) IsDefined(MemberInfo, Type) IsDefined(MemberInfo, Type) 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) IsDefined(MemberInfo, Type, Boolean) IsDefined(MemberInfo, Type, Boolean) 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) GetMetadataToken(MemberInfo) GetMetadataToken(MemberInfo) GetMetadataToken(MemberInfo)
HasMetadataToken(MemberInfo) HasMetadataToken(MemberInfo) HasMetadataToken(MemberInfo) HasMetadataToken(MemberInfo)

Se aplica a