TypeBuilder クラス

定義

実行時のクラスの新しいインスタンスを定義し、作成します。

public ref class TypeBuilder sealed : Type
public ref class TypeBuilder sealed : System::Reflection::TypeInfo
public ref class TypeBuilder abstract : System::Reflection::TypeInfo
public ref class TypeBuilder sealed : Type, System::Runtime::InteropServices::_TypeBuilder
public ref class TypeBuilder sealed : System::Reflection::TypeInfo, System::Runtime::InteropServices::_TypeBuilder
public sealed class TypeBuilder : Type
public sealed class TypeBuilder : System.Reflection.TypeInfo
public abstract class TypeBuilder : System.Reflection.TypeInfo
[System.Runtime.InteropServices.ClassInterface(System.Runtime.InteropServices.ClassInterfaceType.None)]
public sealed class TypeBuilder : Type, System.Runtime.InteropServices._TypeBuilder
[System.Runtime.InteropServices.ClassInterface(System.Runtime.InteropServices.ClassInterfaceType.None)]
[System.Runtime.InteropServices.ComVisible(true)]
public sealed class TypeBuilder : Type, System.Runtime.InteropServices._TypeBuilder
[System.Runtime.InteropServices.ClassInterface(System.Runtime.InteropServices.ClassInterfaceType.None)]
[System.Runtime.InteropServices.ComVisible(true)]
public sealed class TypeBuilder : System.Reflection.TypeInfo, System.Runtime.InteropServices._TypeBuilder
type TypeBuilder = class
    inherit Type
type TypeBuilder = class
    inherit TypeInfo
[<System.Runtime.InteropServices.ClassInterface(System.Runtime.InteropServices.ClassInterfaceType.None)>]
type TypeBuilder = class
    inherit Type
    interface _TypeBuilder
[<System.Runtime.InteropServices.ClassInterface(System.Runtime.InteropServices.ClassInterfaceType.None)>]
[<System.Runtime.InteropServices.ComVisible(true)>]
type TypeBuilder = class
    inherit Type
    interface _TypeBuilder
[<System.Runtime.InteropServices.ClassInterface(System.Runtime.InteropServices.ClassInterfaceType.None)>]
[<System.Runtime.InteropServices.ComVisible(true)>]
type TypeBuilder = class
    inherit TypeInfo
    interface _TypeBuilder
Public NotInheritable Class TypeBuilder
Inherits Type
Public NotInheritable Class TypeBuilder
Inherits TypeInfo
Public MustInherit Class TypeBuilder
Inherits TypeInfo
Public NotInheritable Class TypeBuilder
Inherits Type
Implements _TypeBuilder
Public NotInheritable Class TypeBuilder
Inherits TypeInfo
Implements _TypeBuilder
継承
TypeBuilder
継承
TypeBuilder
継承
属性
実装

次のコード例は、動的アセンブリを定義して使用する方法を示しています。 この例のアセンブリには、プライベート フィールド、 MyDynamicTypeプライベート フィールドを取得および設定するプロパティ、プライベート フィールドを初期化するコンストラクター、およびユーザー指定の数値にプライベート フィールド値を乗算して結果を返すメソッドを含む 1 つの型 が含まれています。

using namespace System;
using namespace System::Reflection;
using namespace System::Reflection::Emit;

void main()
{
    // This code creates an assembly that contains one type,
    // named "MyDynamicType", that has a private field, a property
    // that gets and sets the private field, constructors that
    // initialize the private field, and a method that multiplies
    // a user-supplied number by the private field value and returns
    // the result. In Visual C++ the type might look like this:
    /*
      public ref class MyDynamicType
      {
      private:
          int m_number;

      public:
          MyDynamicType() : m_number(42) {};
          MyDynamicType(int initNumber) : m_number(initNumber) {};
      
          property int Number
          {
              int get() { return m_number; }
              void set(int value) { m_number = value; }
          }

          int MyMethod(int multiplier)
          {
              return m_number * multiplier;
          }
      };
    */
      
    AssemblyName^ aName = gcnew AssemblyName("DynamicAssemblyExample");
    AssemblyBuilder^ ab = 
        AssemblyBuilder::DefineDynamicAssembly(
            aName, 
            AssemblyBuilderAccess::Run);

    // The module name is usually the same as the assembly name
    ModuleBuilder^ mb = 
        ab->DefineDynamicModule(aName->Name);
      
    TypeBuilder^ tb = mb->DefineType(
        "MyDynamicType", 
         TypeAttributes::Public);

    // Add a private field of type int (Int32).
    FieldBuilder^ fbNumber = tb->DefineField(
        "m_number", 
        int::typeid, 
        FieldAttributes::Private);

    // Define a constructor that takes an integer argument and 
    // stores it in the private field. 
    array<Type^>^ parameterTypes = { int::typeid };
    ConstructorBuilder^ ctor1 = tb->DefineConstructor(
        MethodAttributes::Public, 
        CallingConventions::Standard, 
        parameterTypes);

    ILGenerator^ ctor1IL = ctor1->GetILGenerator();
    // For a constructor, argument zero is a reference to the new
    // instance. Push it on the stack before calling the base
    // class constructor. Specify the default constructor of the 
    // base class (System::Object) by passing an empty array of 
    // types (Type::EmptyTypes) to GetConstructor.
    ctor1IL->Emit(OpCodes::Ldarg_0);
    ctor1IL->Emit(OpCodes::Call, 
        Object::typeid->GetConstructor(Type::EmptyTypes));
    // Push the instance on the stack before pushing the argument
    // that is to be assigned to the private field m_number.
    ctor1IL->Emit(OpCodes::Ldarg_0);
    ctor1IL->Emit(OpCodes::Ldarg_1);
    ctor1IL->Emit(OpCodes::Stfld, fbNumber);
    ctor1IL->Emit(OpCodes::Ret);

    // Define a default constructor that supplies a default value
    // for the private field. For parameter types, pass the empty
    // array of types or pass nullptr.
    ConstructorBuilder^ ctor0 = tb->DefineConstructor(
        MethodAttributes::Public, 
        CallingConventions::Standard, 
        Type::EmptyTypes);

    ILGenerator^ ctor0IL = ctor0->GetILGenerator();
    ctor0IL->Emit(OpCodes::Ldarg_0);
    ctor0IL->Emit(OpCodes::Call, 
        Object::typeid->GetConstructor(Type::EmptyTypes));
    // For a constructor, argument zero is a reference to the new
    // instance. Push it on the stack before pushing the default
    // value on the stack.
    ctor0IL->Emit(OpCodes::Ldarg_0);
    ctor0IL->Emit(OpCodes::Ldc_I4_S, 42);
    ctor0IL->Emit(OpCodes::Stfld, fbNumber);
    ctor0IL->Emit(OpCodes::Ret);

    // Define a property named Number that gets and sets the private 
    // field.
    //
    // The last argument of DefineProperty is nullptr, because the
    // property has no parameters. (If you don't specify nullptr, you must
    // specify an array of Type objects. For a parameterless property,
    // use the built-in array with no elements: Type::EmptyTypes)
    PropertyBuilder^ pbNumber = tb->DefineProperty(
        "Number", 
        PropertyAttributes::HasDefault, 
        int::typeid, 
        nullptr);
      
    // The property "set" and property "get" methods require a special
    // set of attributes.
    MethodAttributes getSetAttr = MethodAttributes::Public | 
        MethodAttributes::SpecialName | MethodAttributes::HideBySig;

    // Define the "get" accessor method for Number. The method returns
    // an integer and has no arguments. (Note that nullptr could be 
    // used instead of Types::EmptyTypes)
    MethodBuilder^ mbNumberGetAccessor = tb->DefineMethod(
        "get_Number", 
        getSetAttr, 
        int::typeid, 
        Type::EmptyTypes);
      
    ILGenerator^ numberGetIL = mbNumberGetAccessor->GetILGenerator();
    // For an instance property, argument zero is the instance. Load the 
    // instance, then load the private field and return, leaving the
    // field value on the stack.
    numberGetIL->Emit(OpCodes::Ldarg_0);
    numberGetIL->Emit(OpCodes::Ldfld, fbNumber);
    numberGetIL->Emit(OpCodes::Ret);
    
    // Define the "set" accessor method for Number, which has no return
    // type and takes one argument of type int (Int32).
    MethodBuilder^ mbNumberSetAccessor = tb->DefineMethod(
        "set_Number", 
        getSetAttr, 
        nullptr, 
        gcnew array<Type^> { int::typeid });
      
    ILGenerator^ numberSetIL = mbNumberSetAccessor->GetILGenerator();
    // Load the instance and then the numeric argument, then store the
    // argument in the field.
    numberSetIL->Emit(OpCodes::Ldarg_0);
    numberSetIL->Emit(OpCodes::Ldarg_1);
    numberSetIL->Emit(OpCodes::Stfld, fbNumber);
    numberSetIL->Emit(OpCodes::Ret);
      
    // Last, map the "get" and "set" accessor methods to the 
    // PropertyBuilder. The property is now complete. 
    pbNumber->SetGetMethod(mbNumberGetAccessor);
    pbNumber->SetSetMethod(mbNumberSetAccessor);

    // Define a method that accepts an integer argument and returns
    // the product of that integer and the private field m_number. This
    // time, the array of parameter types is created on the fly.
    MethodBuilder^ meth = tb->DefineMethod(
        "MyMethod", 
        MethodAttributes::Public, 
        int::typeid, 
        gcnew array<Type^> { int::typeid });

    ILGenerator^ methIL = meth->GetILGenerator();
    // To retrieve the private instance field, load the instance it
    // belongs to (argument zero). After loading the field, load the 
    // argument one and then multiply. Return from the method with 
    // the return value (the product of the two numbers) on the 
    // execution stack.
    methIL->Emit(OpCodes::Ldarg_0);
    methIL->Emit(OpCodes::Ldfld, fbNumber);
    methIL->Emit(OpCodes::Ldarg_1);
    methIL->Emit(OpCodes::Mul);
    methIL->Emit(OpCodes::Ret);

    // Finish the type->
    Type^ t = tb->CreateType();

    // Because AssemblyBuilderAccess includes Run, the code can be
    // executed immediately. Start by getting reflection objects for
    // the method and the property.
    MethodInfo^ mi = t->GetMethod("MyMethod");
    PropertyInfo^ pi = t->GetProperty("Number");
  
    // Create an instance of MyDynamicType using the default 
    // constructor. 
    Object^ o1 = Activator::CreateInstance(t);

    // Display the value of the property, then change it to 127 and 
    // display it again. Use nullptr to indicate that the property
    // has no index.
    Console::WriteLine("o1->Number: {0}", pi->GetValue(o1, nullptr));
    pi->SetValue(o1, 127, nullptr);
    Console::WriteLine("o1->Number: {0}", pi->GetValue(o1, nullptr));

    // Call MyMethod, passing 22, and display the return value, 22
    // times 127. Arguments must be passed as an array, even when
    // there is only one.
    array<Object^>^ arguments = { 22 };
    Console::WriteLine("o1->MyMethod(22): {0}", 
        mi->Invoke(o1, arguments));

    // Create an instance of MyDynamicType using the constructor
    // that specifies m_Number. The constructor is identified by
    // matching the types in the argument array. In this case, 
    // the argument array is created on the fly. Display the 
    // property value.
    Object^ o2 = Activator::CreateInstance(t, 
        gcnew array<Object^> { 5280 });
    Console::WriteLine("o2->Number: {0}", pi->GetValue(o2, nullptr));
};

/* This code produces the following output:

o1->Number: 42
o1->Number: 127
o1->MyMethod(22): 2794
o2->Number: 5280
 */
using System;
using System.Reflection;
using System.Reflection.Emit;

class DemoAssemblyBuilder
{
    public static void Main()
    {
        // This code creates an assembly that contains one type,
        // named "MyDynamicType", that has a private field, a property
        // that gets and sets the private field, constructors that
        // initialize the private field, and a method that multiplies
        // a user-supplied number by the private field value and returns
        // the result. In C# the type might look like this:
        /*
        public class MyDynamicType
        {
            private int m_number;

            public MyDynamicType() : this(42) {}
            public MyDynamicType(int initNumber)
            {
                m_number = initNumber;
            }

            public int Number
            {
                get { return m_number; }
                set { m_number = value; }
            }

            public int MyMethod(int multiplier)
            {
                return m_number * multiplier;
            }
        }
        */

        var aName = new AssemblyName("DynamicAssemblyExample");
        AssemblyBuilder ab =
            AssemblyBuilder.DefineDynamicAssembly(
                aName,
                AssemblyBuilderAccess.Run);

        // The module name is usually the same as the assembly name.
        ModuleBuilder mb = ab.DefineDynamicModule(aName.Name ?? "DynamicAssemblyExample");

        TypeBuilder tb = mb.DefineType(
            "MyDynamicType",
             TypeAttributes.Public);

        // Add a private field of type int (Int32).
        FieldBuilder fbNumber = tb.DefineField(
            "m_number",
            typeof(int),
            FieldAttributes.Private);

        // Define a constructor that takes an integer argument and
        // stores it in the private field.
        Type[] parameterTypes = { typeof(int) };
        ConstructorBuilder ctor1 = tb.DefineConstructor(
            MethodAttributes.Public,
            CallingConventions.Standard,
            parameterTypes);

        ILGenerator ctor1IL = ctor1.GetILGenerator();
        // For a constructor, argument zero is a reference to the new
        // instance. Push it on the stack before calling the base
        // class constructor. Specify the default constructor of the
        // base class (System.Object) by passing an empty array of
        // types (Type.EmptyTypes) to GetConstructor.
        ctor1IL.Emit(OpCodes.Ldarg_0);
        ConstructorInfo? ci = typeof(object).GetConstructor(Type.EmptyTypes);
        ctor1IL.Emit(OpCodes.Call, ci!);
        // Push the instance on the stack before pushing the argument
        // that is to be assigned to the private field m_number.
        ctor1IL.Emit(OpCodes.Ldarg_0);
        ctor1IL.Emit(OpCodes.Ldarg_1);
        ctor1IL.Emit(OpCodes.Stfld, fbNumber);
        ctor1IL.Emit(OpCodes.Ret);

        // Define a default constructor that supplies a default value
        // for the private field. For parameter types, pass the empty
        // array of types or pass null.
        ConstructorBuilder ctor0 = tb.DefineConstructor(
            MethodAttributes.Public,
            CallingConventions.Standard,
            Type.EmptyTypes);

        ILGenerator ctor0IL = ctor0.GetILGenerator();
        // For a constructor, argument zero is a reference to the new
        // instance. Push it on the stack before pushing the default
        // value on the stack, then call constructor ctor1.
        ctor0IL.Emit(OpCodes.Ldarg_0);
        ctor0IL.Emit(OpCodes.Ldc_I4_S, 42);
        ctor0IL.Emit(OpCodes.Call, ctor1);
        ctor0IL.Emit(OpCodes.Ret);

        // Define a property named Number that gets and sets the private
        // field.
        //
        // The last argument of DefineProperty is null, because the
        // property has no parameters. (If you don't specify null, you must
        // specify an array of Type objects. For a parameterless property,
        // use the built-in array with no elements: Type.EmptyTypes)
        PropertyBuilder pbNumber = tb.DefineProperty(
            "Number",
            PropertyAttributes.HasDefault,
            typeof(int),
            null);

        // The property "set" and property "get" methods require a special
        // set of attributes.
        MethodAttributes getSetAttr = MethodAttributes.Public |
            MethodAttributes.SpecialName | MethodAttributes.HideBySig;

        // Define the "get" accessor method for Number. The method returns
        // an integer and has no arguments. (Note that null could be
        // used instead of Types.EmptyTypes)
        MethodBuilder mbNumberGetAccessor = tb.DefineMethod(
            "get_Number",
            getSetAttr,
            typeof(int),
            Type.EmptyTypes);

        ILGenerator numberGetIL = mbNumberGetAccessor.GetILGenerator();
        // For an instance property, argument zero is the instance. Load the
        // instance, then load the private field and return, leaving the
        // field value on the stack.
        numberGetIL.Emit(OpCodes.Ldarg_0);
        numberGetIL.Emit(OpCodes.Ldfld, fbNumber);
        numberGetIL.Emit(OpCodes.Ret);

        // Define the "set" accessor method for Number, which has no return
        // type and takes one argument of type int (Int32).
        MethodBuilder mbNumberSetAccessor = tb.DefineMethod(
            "set_Number",
            getSetAttr,
            null,
            new Type[] { typeof(int) });

        ILGenerator numberSetIL = mbNumberSetAccessor.GetILGenerator();
        // Load the instance and then the numeric argument, then store the
        // argument in the field.
        numberSetIL.Emit(OpCodes.Ldarg_0);
        numberSetIL.Emit(OpCodes.Ldarg_1);
        numberSetIL.Emit(OpCodes.Stfld, fbNumber);
        numberSetIL.Emit(OpCodes.Ret);

        // Last, map the "get" and "set" accessor methods to the
        // PropertyBuilder. The property is now complete.
        pbNumber.SetGetMethod(mbNumberGetAccessor);
        pbNumber.SetSetMethod(mbNumberSetAccessor);

        // Define a method that accepts an integer argument and returns
        // the product of that integer and the private field m_number. This
        // time, the array of parameter types is created on the fly.
        MethodBuilder meth = tb.DefineMethod(
            "MyMethod",
            MethodAttributes.Public,
            typeof(int),
            new Type[] { typeof(int) });

        ILGenerator methIL = meth.GetILGenerator();
        // To retrieve the private instance field, load the instance it
        // belongs to (argument zero). After loading the field, load the
        // argument one and then multiply. Return from the method with
        // the return value (the product of the two numbers) on the
        // execution stack.
        methIL.Emit(OpCodes.Ldarg_0);
        methIL.Emit(OpCodes.Ldfld, fbNumber);
        methIL.Emit(OpCodes.Ldarg_1);
        methIL.Emit(OpCodes.Mul);
        methIL.Emit(OpCodes.Ret);

        // Finish the type.
        Type? t = tb.CreateType();

        // Because AssemblyBuilderAccess includes Run, the code can be
        // executed immediately. Start by getting reflection objects for
        // the method and the property.
        MethodInfo? mi = t?.GetMethod("MyMethod");
        PropertyInfo? pi = t?.GetProperty("Number");

        // Create an instance of MyDynamicType using the default
        // constructor.
        object? o1 = null;
        if (t is not null)
            o1 = Activator.CreateInstance(t);

        // Display the value of the property, then change it to 127 and
        // display it again. Use null to indicate that the property
        // has no index.
        Console.WriteLine("o1.Number: {0}", pi?.GetValue(o1, null));
        pi?.SetValue(o1, 127, null);
        Console.WriteLine("o1.Number: {0}", pi?.GetValue(o1, null));

        // Call MyMethod, passing 22, and display the return value, 22
        // times 127. Arguments must be passed as an array, even when
        // there is only one.
        object[] arguments = { 22 };
        Console.WriteLine("o1.MyMethod(22): {0}",
            mi?.Invoke(o1, arguments));

        // Create an instance of MyDynamicType using the constructor
        // that specifies m_Number. The constructor is identified by
        // matching the types in the argument array. In this case,
        // the argument array is created on the fly. Display the
        // property value.
        object? o2 = null;
        if (t is not null)
            Activator.CreateInstance(t, new object[] { 5280 });
        Console.WriteLine("o2.Number: {0}", pi?.GetValue(o2, null));
    }
}

/* This code produces the following output:

o1.Number: 42
o1.Number: 127
o1.MyMethod(22): 2794
o2.Number: 5280
 */
Imports System.Reflection
Imports System.Reflection.Emit

Class DemoAssemblyBuilder

    Public Shared Sub Main()

        ' This code creates an assembly that contains one type,
        ' named "MyDynamicType", that has a private field, a property
        ' that gets and sets the private field, constructors that
        ' initialize the private field, and a method that multiplies
        ' a user-supplied number by the private field value and returns
        ' the result. The code might look like this in Visual Basic:
        '
        'Public Class MyDynamicType
        '    Private m_number As Integer
        '
        '    Public Sub New()
        '        Me.New(42)
        '    End Sub
        '
        '    Public Sub New(ByVal initNumber As Integer)
        '        m_number = initNumber
        '    End Sub
        '
        '    Public Property Number As Integer
        '        Get
        '            Return m_number
        '        End Get
        '        Set
        '            m_Number = Value
        '        End Set
        '    End Property
        '
        '    Public Function MyMethod(ByVal multiplier As Integer) As Integer
        '        Return m_Number * multiplier
        '    End Function
        'End Class
      
        Dim aName As New AssemblyName("DynamicAssemblyExample")
        Dim ab As AssemblyBuilder = _
            AssemblyBuilder.DefineDynamicAssembly( _
                aName, _
                AssemblyBuilderAccess.Run)

        ' The module name is usually the same as the assembly name.
        Dim mb As ModuleBuilder = ab.DefineDynamicModule( _
            aName.Name)
      
        Dim tb As TypeBuilder = _
            mb.DefineType("MyDynamicType", TypeAttributes.Public)

        ' Add a private field of type Integer (Int32).
        Dim fbNumber As FieldBuilder = tb.DefineField( _
            "m_number", _
            GetType(Integer), _
            FieldAttributes.Private)

        ' Define a constructor that takes an integer argument and 
        ' stores it in the private field. 
        Dim parameterTypes() As Type = { GetType(Integer) }
        Dim ctor1 As ConstructorBuilder = _
            tb.DefineConstructor( _
                MethodAttributes.Public, _
                CallingConventions.Standard, _
                parameterTypes)

        Dim ctor1IL As ILGenerator = ctor1.GetILGenerator()
        ' For a constructor, argument zero is a reference to the new
        ' instance. Push it on the stack before calling the base
        ' class constructor. Specify the default constructor of the 
        ' base class (System.Object) by passing an empty array of 
        ' types (Type.EmptyTypes) to GetConstructor.
        ctor1IL.Emit(OpCodes.Ldarg_0)
        ctor1IL.Emit(OpCodes.Call, _
            GetType(Object).GetConstructor(Type.EmptyTypes))
        ' Push the instance on the stack before pushing the argument
        ' that is to be assigned to the private field m_number.
        ctor1IL.Emit(OpCodes.Ldarg_0)
        ctor1IL.Emit(OpCodes.Ldarg_1)
        ctor1IL.Emit(OpCodes.Stfld, fbNumber)
        ctor1IL.Emit(OpCodes.Ret)

        ' Define a default constructor that supplies a default value
        ' for the private field. For parameter types, pass the empty
        ' array of types or pass Nothing.
        Dim ctor0 As ConstructorBuilder = tb.DefineConstructor( _
            MethodAttributes.Public, _
            CallingConventions.Standard, _
            Type.EmptyTypes)

        Dim ctor0IL As ILGenerator = ctor0.GetILGenerator()
        ' For a constructor, argument zero is a reference to the new
        ' instance. Push it on the stack before pushing the default
        ' value on the stack, then call constructor ctor1.
        ctor0IL.Emit(OpCodes.Ldarg_0)
        ctor0IL.Emit(OpCodes.Ldc_I4_S, 42)
        ctor0IL.Emit(OpCodes.Call, ctor1)
        ctor0IL.Emit(OpCodes.Ret)

        ' Define a property named Number that gets and sets the private 
        ' field.
        '
        ' The last argument of DefineProperty is Nothing, because the
        ' property has no parameters. (If you don't specify Nothing, you must
        ' specify an array of Type objects. For a parameterless property,
        ' use the built-in array with no elements: Type.EmptyTypes)
        Dim pbNumber As PropertyBuilder = tb.DefineProperty( _
            "Number", _
            PropertyAttributes.HasDefault, _
            GetType(Integer), _
            Nothing)
      
        ' The property Set and property Get methods require a special
        ' set of attributes.
        Dim getSetAttr As MethodAttributes = _
            MethodAttributes.Public Or MethodAttributes.SpecialName _
                Or MethodAttributes.HideBySig

        ' Define the "get" accessor method for Number. The method returns
        ' an integer and has no arguments. (Note that Nothing could be 
        ' used instead of Types.EmptyTypes)
        Dim mbNumberGetAccessor As MethodBuilder = tb.DefineMethod( _
            "get_Number", _
            getSetAttr, _
            GetType(Integer), _
            Type.EmptyTypes)
      
        Dim numberGetIL As ILGenerator = mbNumberGetAccessor.GetILGenerator()
        ' For an instance property, argument zero is the instance. Load the 
        ' instance, then load the private field and return, leaving the
        ' field value on the stack.
        numberGetIL.Emit(OpCodes.Ldarg_0)
        numberGetIL.Emit(OpCodes.Ldfld, fbNumber)
        numberGetIL.Emit(OpCodes.Ret)
        
        ' Define the "set" accessor method for Number, which has no return
        ' type and takes one argument of type Integer (Int32).
        Dim mbNumberSetAccessor As MethodBuilder = _
            tb.DefineMethod( _
                "set_Number", _
                getSetAttr, _
                Nothing, _
                New Type() { GetType(Integer) })
      
        Dim numberSetIL As ILGenerator = mbNumberSetAccessor.GetILGenerator()
        ' Load the instance and then the numeric argument, then store the
        ' argument in the field.
        numberSetIL.Emit(OpCodes.Ldarg_0)
        numberSetIL.Emit(OpCodes.Ldarg_1)
        numberSetIL.Emit(OpCodes.Stfld, fbNumber)
        numberSetIL.Emit(OpCodes.Ret)
      
        ' Last, map the "get" and "set" accessor methods to the 
        ' PropertyBuilder. The property is now complete. 
        pbNumber.SetGetMethod(mbNumberGetAccessor)
        pbNumber.SetSetMethod(mbNumberSetAccessor)

        ' Define a method that accepts an integer argument and returns
        ' the product of that integer and the private field m_number. This
        ' time, the array of parameter types is created on the fly.
        Dim meth As MethodBuilder = tb.DefineMethod( _
            "MyMethod", _
            MethodAttributes.Public, _
            GetType(Integer), _
            New Type() { GetType(Integer) })

        Dim methIL As ILGenerator = meth.GetILGenerator()
        ' To retrieve the private instance field, load the instance it
        ' belongs to (argument zero). After loading the field, load the 
        ' argument one and then multiply. Return from the method with 
        ' the return value (the product of the two numbers) on the 
        ' execution stack.
        methIL.Emit(OpCodes.Ldarg_0)
        methIL.Emit(OpCodes.Ldfld, fbNumber)
        methIL.Emit(OpCodes.Ldarg_1)
        methIL.Emit(OpCodes.Mul)
        methIL.Emit(OpCodes.Ret)

        ' Finish the type.
        Dim t As Type = tb.CreateType()

        ' Because AssemblyBuilderAccess includes Run, the code can be
        ' executed immediately. Start by getting reflection objects for
        ' the method and the property.
        Dim mi As MethodInfo = t.GetMethod("MyMethod")
        Dim pi As PropertyInfo = t.GetProperty("Number")
  
        ' Create an instance of MyDynamicType using the default 
        ' constructor. 
        Dim o1 As Object = Activator.CreateInstance(t)

        ' Display the value of the property, then change it to 127 and 
        ' display it again. Use Nothing to indicate that the property
        ' has no index.
        Console.WriteLine("o1.Number: {0}", pi.GetValue(o1, Nothing))
        pi.SetValue(o1, 127, Nothing)
        Console.WriteLine("o1.Number: {0}", pi.GetValue(o1, Nothing))

        ' Call MyMethod, passing 22, and display the return value, 22
        ' times 127. Arguments must be passed as an array, even when
        ' there is only one.
        Dim arguments() As Object = { 22 }
        Console.WriteLine("o1.MyMethod(22): {0}", _
            mi.Invoke(o1, arguments))

        ' Create an instance of MyDynamicType using the constructor
        ' that specifies m_Number. The constructor is identified by
        ' matching the types in the argument array. In this case, 
        ' the argument array is created on the fly. Display the 
        ' property value.
        Dim o2 As Object = Activator.CreateInstance(t, _
            New Object() { 5280 })
        Console.WriteLine("o2.Number: {0}", pi.GetValue(o2, Nothing))
      
    End Sub  
End Class

' This code produces the following output:
'
'o1.Number: 42
'o1.Number: 127
'o1.MyMethod(22): 2794
'o2.Number: 5280

次のコード サンプルは、 を使用 TypeBuilderして型を動的に構築する方法を示しています。

using namespace System;
using namespace System::Threading;
using namespace System::Reflection;
using namespace System::Reflection::Emit;
Type^ DynamicDotProductGen()
{
   Type^ ivType = nullptr;
   array<Type^>^temp0 = {int::typeid,int::typeid,int::typeid};
   array<Type^>^ctorParams = temp0;
   AppDomain^ myDomain = Thread::GetDomain();
   AssemblyName^ myAsmName = gcnew AssemblyName;
   myAsmName->Name = "IntVectorAsm";
   AssemblyBuilder^ myAsmBuilder = myDomain->DefineDynamicAssembly( myAsmName, AssemblyBuilderAccess::RunAndSave );
   ModuleBuilder^ IntVectorModule = myAsmBuilder->DefineDynamicModule( "IntVectorModule", "Vector.dll" );
   TypeBuilder^ ivTypeBld = IntVectorModule->DefineType( "IntVector", TypeAttributes::Public );
   FieldBuilder^ xField = ivTypeBld->DefineField( "x", int::typeid, FieldAttributes::Private );
   FieldBuilder^ yField = ivTypeBld->DefineField( "y", int::typeid, FieldAttributes::Private );
   FieldBuilder^ zField = ivTypeBld->DefineField( "z", int::typeid, FieldAttributes::Private );
   Type^ objType = Type::GetType( "System.Object" );
   ConstructorInfo^ objCtor = objType->GetConstructor( gcnew array<Type^>(0) );
   ConstructorBuilder^ ivCtor = ivTypeBld->DefineConstructor( MethodAttributes::Public, CallingConventions::Standard, ctorParams );
   ILGenerator^ ctorIL = ivCtor->GetILGenerator();
   ctorIL->Emit( OpCodes::Ldarg_0 );
   ctorIL->Emit( OpCodes::Call, objCtor );
   ctorIL->Emit( OpCodes::Ldarg_0 );
   ctorIL->Emit( OpCodes::Ldarg_1 );
   ctorIL->Emit( OpCodes::Stfld, xField );
   ctorIL->Emit( OpCodes::Ldarg_0 );
   ctorIL->Emit( OpCodes::Ldarg_2 );
   ctorIL->Emit( OpCodes::Stfld, yField );
   ctorIL->Emit( OpCodes::Ldarg_0 );
   ctorIL->Emit( OpCodes::Ldarg_3 );
   ctorIL->Emit( OpCodes::Stfld, zField );
   ctorIL->Emit( OpCodes::Ret );
   
   // This method will find the dot product of the stored vector
   // with another.
   array<Type^>^temp1 = {ivTypeBld};
   array<Type^>^dpParams = temp1;
   
   // Here, you create a MethodBuilder containing the
   // name, the attributes (public, static, private, and so on),
   // the return type (int, in this case), and a array of Type
   // indicating the type of each parameter. Since the sole parameter
   // is a IntVector, the very class you're creating, you will
   // pass in the TypeBuilder (which is derived from Type) instead of
   // a Type object for IntVector, avoiding an exception.
   // -- This method would be declared in C# as:
   //    public int DotProduct(IntVector aVector)
   MethodBuilder^ dotProductMthd = ivTypeBld->DefineMethod( "DotProduct", MethodAttributes::Public, int::typeid, dpParams );
   
   // A ILGenerator can now be spawned, attached to the MethodBuilder.
   ILGenerator^ mthdIL = dotProductMthd->GetILGenerator();
   
   // Here's the body of our function, in MSIL form. We're going to find the
   // "dot product" of the current vector instance with the passed vector
   // instance. For reference purposes, the equation is:
   // (x1 * x2) + (y1 * y2) + (z1 * z2) = the dot product
   // First, you'll load the reference to the current instance "this"
   // stored in argument 0 (ldarg.0) onto the stack. Ldfld, the subsequent
   // instruction, will pop the reference off the stack and look up the
   // field "x", specified by the FieldInfo token "xField".
   mthdIL->Emit( OpCodes::Ldarg_0 );
   mthdIL->Emit( OpCodes::Ldfld, xField );
   
   // That completed, the value stored at field "x" is now atop the stack.
   // Now, you'll do the same for the Object reference we passed as a
   // parameter, stored in argument 1 (ldarg.1). After Ldfld executed,
   // you'll have the value stored in field "x" for the passed instance
   // atop the stack.
   mthdIL->Emit( OpCodes::Ldarg_1 );
   mthdIL->Emit( OpCodes::Ldfld, xField );
   
   // There will now be two values atop the stack - the "x" value for the
   // current vector instance, and the "x" value for the passed instance.
   // You'll now multiply them, and push the result onto the evaluation stack.
   mthdIL->Emit( OpCodes::Mul_Ovf_Un );
   
   // Now, repeat this for the "y" fields of both vectors.
   mthdIL->Emit( OpCodes::Ldarg_0 );
   mthdIL->Emit( OpCodes::Ldfld, yField );
   mthdIL->Emit( OpCodes::Ldarg_1 );
   mthdIL->Emit( OpCodes::Ldfld, yField );
   mthdIL->Emit( OpCodes::Mul_Ovf_Un );
   
   // At this time, the results of both multiplications should be atop
   // the stack. You'll now add them and push the result onto the stack.
   mthdIL->Emit( OpCodes::Add_Ovf_Un );
   
   // Multiply both "z" field and push the result onto the stack.
   mthdIL->Emit( OpCodes::Ldarg_0 );
   mthdIL->Emit( OpCodes::Ldfld, zField );
   mthdIL->Emit( OpCodes::Ldarg_1 );
   mthdIL->Emit( OpCodes::Ldfld, zField );
   mthdIL->Emit( OpCodes::Mul_Ovf_Un );
   
   // Finally, add the result of multiplying the "z" fields with the
   // result of the earlier addition, and push the result - the dot product -
   // onto the stack.
   mthdIL->Emit( OpCodes::Add_Ovf_Un );
   
   // The "ret" opcode will pop the last value from the stack and return it
   // to the calling method. You're all done!
   mthdIL->Emit( OpCodes::Ret );
   ivType = ivTypeBld->CreateType();
   return ivType;
}

int main()
{
   Type^ IVType = nullptr;
   Object^ aVector1 = nullptr;
   Object^ aVector2 = nullptr;
   array<Type^>^temp2 = {int::typeid,int::typeid,int::typeid};
   array<Type^>^aVtypes = temp2;
   array<Object^>^temp3 = {10,10,10};
   array<Object^>^aVargs1 = temp3;
   array<Object^>^temp4 = {20,20,20};
   array<Object^>^aVargs2 = temp4;
   
   // Call the  method to build our dynamic class.
   IVType = DynamicDotProductGen();
   Console::WriteLine( "---" );
   ConstructorInfo^ myDTctor = IVType->GetConstructor( aVtypes );
   aVector1 = myDTctor->Invoke( aVargs1 );
   aVector2 = myDTctor->Invoke( aVargs2 );
   array<Object^>^passMe = gcnew array<Object^>(1);
   passMe[ 0 ] = dynamic_cast<Object^>(aVector2);
   Console::WriteLine( "(10, 10, 10) . (20, 20, 20) = {0}", IVType->InvokeMember( "DotProduct", BindingFlags::InvokeMethod, nullptr, aVector1, passMe ) );
}

// +++ OUTPUT +++
// ---
// (10, 10, 10) . (20, 20, 20) = 600
using System;
using System.Threading;
using System.Reflection;
using System.Reflection.Emit;

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

       ModuleBuilder IntVectorModule = myAsmBuilder.DefineDynamicModule("IntVectorModule",
                                        "Vector.dll");

       TypeBuilder ivTypeBld = IntVectorModule.DefineType("IntVector",
                                      TypeAttributes.Public);

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

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

       ConstructorBuilder ivCtor = ivTypeBld.DefineConstructor(
                      MethodAttributes.Public,
                      CallingConventions.Standard,
                      ctorParams);
       ILGenerator ctorIL = ivCtor.GetILGenerator();
           ctorIL.Emit(OpCodes.Ldarg_0);
           ctorIL.Emit(OpCodes.Call, objCtor);
           ctorIL.Emit(OpCodes.Ldarg_0);
           ctorIL.Emit(OpCodes.Ldarg_1);
           ctorIL.Emit(OpCodes.Stfld, xField);
           ctorIL.Emit(OpCodes.Ldarg_0);
           ctorIL.Emit(OpCodes.Ldarg_2);
           ctorIL.Emit(OpCodes.Stfld, yField);
           ctorIL.Emit(OpCodes.Ldarg_0);
           ctorIL.Emit(OpCodes.Ldarg_3);
           ctorIL.Emit(OpCodes.Stfld, zField);
       ctorIL.Emit(OpCodes.Ret);

       // This method will find the dot product of the stored vector
       // with another.

       Type[] dpParams = new Type[] { ivTypeBld };

           // Here, you create a MethodBuilder containing the
       // name, the attributes (public, static, private, and so on),
       // the return type (int, in this case), and a array of Type
       // indicating the type of each parameter. Since the sole parameter
       // is a IntVector, the very class you're creating, you will
       // pass in the TypeBuilder (which is derived from Type) instead of
       // a Type object for IntVector, avoiding an exception.

       // -- This method would be declared in C# as:
       //    public int DotProduct(IntVector aVector)

           MethodBuilder dotProductMthd = ivTypeBld.DefineMethod(
                                  "DotProduct",
                          MethodAttributes.Public,
                                          typeof(int),
                                          dpParams);

       // A ILGenerator can now be spawned, attached to the MethodBuilder.

       ILGenerator mthdIL = dotProductMthd.GetILGenerator();
    
       // Here's the body of our function, in MSIL form. We're going to find the
       // "dot product" of the current vector instance with the passed vector
       // instance. For reference purposes, the equation is:
       // (x1 * x2) + (y1 * y2) + (z1 * z2) = the dot product

       // First, you'll load the reference to the current instance "this"
       // stored in argument 0 (ldarg.0) onto the stack. Ldfld, the subsequent
       // instruction, will pop the reference off the stack and look up the
       // field "x", specified by the FieldInfo token "xField".

       mthdIL.Emit(OpCodes.Ldarg_0);
       mthdIL.Emit(OpCodes.Ldfld, xField);

       // That completed, the value stored at field "x" is now atop the stack.
       // Now, you'll do the same for the object reference we passed as a
       // parameter, stored in argument 1 (ldarg.1). After Ldfld executed,
       // you'll have the value stored in field "x" for the passed instance
       // atop the stack.

       mthdIL.Emit(OpCodes.Ldarg_1);
       mthdIL.Emit(OpCodes.Ldfld, xField);

           // There will now be two values atop the stack - the "x" value for the
       // current vector instance, and the "x" value for the passed instance.
       // You'll now multiply them, and push the result onto the evaluation stack.

       mthdIL.Emit(OpCodes.Mul_Ovf_Un);

       // Now, repeat this for the "y" fields of both vectors.

       mthdIL.Emit(OpCodes.Ldarg_0);
       mthdIL.Emit(OpCodes.Ldfld, yField);
       mthdIL.Emit(OpCodes.Ldarg_1);
       mthdIL.Emit(OpCodes.Ldfld, yField);
       mthdIL.Emit(OpCodes.Mul_Ovf_Un);

       // At this time, the results of both multiplications should be atop
       // the stack. You'll now add them and push the result onto the stack.

       mthdIL.Emit(OpCodes.Add_Ovf_Un);

       // Multiply both "z" field and push the result onto the stack.
       mthdIL.Emit(OpCodes.Ldarg_0);
       mthdIL.Emit(OpCodes.Ldfld, zField);
       mthdIL.Emit(OpCodes.Ldarg_1);
       mthdIL.Emit(OpCodes.Ldfld, zField);
       mthdIL.Emit(OpCodes.Mul_Ovf_Un);

       // Finally, add the result of multiplying the "z" fields with the
       // result of the earlier addition, and push the result - the dot product -
       // onto the stack.
       mthdIL.Emit(OpCodes.Add_Ovf_Un);

       // The "ret" opcode will pop the last value from the stack and return it
       // to the calling method. You're all done!

       mthdIL.Emit(OpCodes.Ret);

       ivType = ivTypeBld.CreateType();

       return ivType;
    }

    public static void Main() {
    
       Type IVType = null;
           object aVector1 = null;
           object aVector2 = null;
       Type[] aVtypes = new Type[] {typeof(int), typeof(int), typeof(int)};
           object[] aVargs1 = new object[] {10, 10, 10};
           object[] aVargs2 = new object[] {20, 20, 20};
    
       // Call the  method to build our dynamic class.

       IVType = DynamicDotProductGen();

           Console.WriteLine("---");

       ConstructorInfo myDTctor = IVType.GetConstructor(aVtypes);
       aVector1 = myDTctor.Invoke(aVargs1);
       aVector2 = myDTctor.Invoke(aVargs2);

       object[] passMe = new object[1];
           passMe[0] = (object)aVector2;

       Console.WriteLine("(10, 10, 10) . (20, 20, 20) = {0}",
                 IVType.InvokeMember("DotProduct",
                          BindingFlags.InvokeMethod,
                          null,
                          aVector1,
                          passMe));

       // +++ OUTPUT +++
       // ---
       // (10, 10, 10) . (20, 20, 20) = 600
    }
}
Imports System.Threading
Imports System.Reflection
Imports System.Reflection.Emit

 _


Class TestILGenerator
   
   
   Public Shared Function DynamicDotProductGen() As Type
      
      Dim ivType 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 = "IntVectorAsm"
      
      Dim myAsmBuilder As AssemblyBuilder = myDomain.DefineDynamicAssembly( _
                        myAsmName, _
                        AssemblyBuilderAccess.RunAndSave)
      
      Dim IntVectorModule As ModuleBuilder = myAsmBuilder.DefineDynamicModule( _
                         "IntVectorModule", _
                         "Vector.dll")
      
      Dim ivTypeBld As TypeBuilder = IntVectorModule.DefineType("IntVector", TypeAttributes.Public)
      
      Dim xField As FieldBuilder = ivTypeBld.DefineField("x", _
                                 GetType(Integer), _
                                 FieldAttributes.Private)
      Dim yField As FieldBuilder = ivTypeBld.DefineField("y", _ 
                                 GetType(Integer), _
                                 FieldAttributes.Private)
      Dim zField As FieldBuilder = ivTypeBld.DefineField("z", _
                                 GetType(Integer), _
                                 FieldAttributes.Private)
      
      
      Dim objType As Type = Type.GetType("System.Object")
      Dim objCtor As ConstructorInfo = objType.GetConstructor(New Type() {})
      
      Dim ivCtor As ConstructorBuilder = ivTypeBld.DefineConstructor( _
                     MethodAttributes.Public, _
                     CallingConventions.Standard, _
                     ctorParams)
      Dim ctorIL As ILGenerator = ivCtor.GetILGenerator()
      ctorIL.Emit(OpCodes.Ldarg_0)
      ctorIL.Emit(OpCodes.Call, objCtor)
      ctorIL.Emit(OpCodes.Ldarg_0)
      ctorIL.Emit(OpCodes.Ldarg_1)
      ctorIL.Emit(OpCodes.Stfld, xField)
      ctorIL.Emit(OpCodes.Ldarg_0)
      ctorIL.Emit(OpCodes.Ldarg_2)
      ctorIL.Emit(OpCodes.Stfld, yField)
      ctorIL.Emit(OpCodes.Ldarg_0)
      ctorIL.Emit(OpCodes.Ldarg_3)
      ctorIL.Emit(OpCodes.Stfld, zField)
      ctorIL.Emit(OpCodes.Ret)
     

      ' Now, you'll construct the method find the dot product of two vectors. First,
      ' let's define the parameters that will be accepted by the method. In this case,
      ' it's an IntVector itself!

      Dim dpParams() As Type = {ivTypeBld}
      
      ' Here, you create a MethodBuilder containing the
      ' name, the attributes (public, static, private, and so on),
      ' the return type (int, in this case), and a array of Type
      ' indicating the type of each parameter. Since the sole parameter
      ' is a IntVector, the very class you're creating, you will
      ' pass in the TypeBuilder (which is derived from Type) instead of 
      ' a Type object for IntVector, avoiding an exception. 
      ' -- This method would be declared in VB.NET as:
      '    Public Function DotProduct(IntVector aVector) As Integer

      Dim dotProductMthd As MethodBuilder = ivTypeBld.DefineMethod("DotProduct", _
                        MethodAttributes.Public, GetType(Integer), _
                                            dpParams)
      
      ' A ILGenerator can now be spawned, attached to the MethodBuilder.
      Dim mthdIL As ILGenerator = dotProductMthd.GetILGenerator()
      
      ' Here's the body of our function, in MSIL form. We're going to find the
      ' "dot product" of the current vector instance with the passed vector 
      ' instance. For reference purposes, the equation is:
      ' (x1 * x2) + (y1 * y2) + (z1 * z2) = the dot product
      ' First, you'll load the reference to the current instance "this"
      ' stored in argument 0 (ldarg.0) onto the stack. Ldfld, the subsequent
      ' instruction, will pop the reference off the stack and look up the
      ' field "x", specified by the FieldInfo token "xField".
      mthdIL.Emit(OpCodes.Ldarg_0)
      mthdIL.Emit(OpCodes.Ldfld, xField)
      
      ' That completed, the value stored at field "x" is now atop the stack.
      ' Now, you'll do the same for the object reference we passed as a
      ' parameter, stored in argument 1 (ldarg.1). After Ldfld executed,
      ' you'll have the value stored in field "x" for the passed instance
      ' atop the stack.
      mthdIL.Emit(OpCodes.Ldarg_1)
      mthdIL.Emit(OpCodes.Ldfld, xField)
      
      ' There will now be two values atop the stack - the "x" value for the
      ' current vector instance, and the "x" value for the passed instance.
      ' You'll now multiply them, and push the result onto the evaluation stack.
      mthdIL.Emit(OpCodes.Mul_Ovf_Un)
      
      ' Now, repeat this for the "y" fields of both vectors.
      mthdIL.Emit(OpCodes.Ldarg_0)
      mthdIL.Emit(OpCodes.Ldfld, yField)
      mthdIL.Emit(OpCodes.Ldarg_1)
      mthdIL.Emit(OpCodes.Ldfld, yField)
      mthdIL.Emit(OpCodes.Mul_Ovf_Un)
      
      ' At this time, the results of both multiplications should be atop
      ' the stack. You'll now add them and push the result onto the stack.
      mthdIL.Emit(OpCodes.Add_Ovf_Un)
      
      ' Multiply both "z" field and push the result onto the stack.
      mthdIL.Emit(OpCodes.Ldarg_0)
      mthdIL.Emit(OpCodes.Ldfld, zField)
      mthdIL.Emit(OpCodes.Ldarg_1)
      mthdIL.Emit(OpCodes.Ldfld, zField)
      mthdIL.Emit(OpCodes.Mul_Ovf_Un)
      
      ' Finally, add the result of multiplying the "z" fields with the
      ' result of the earlier addition, and push the result - the dot product -
      ' onto the stack.
      mthdIL.Emit(OpCodes.Add_Ovf_Un)
      
      ' The "ret" opcode will pop the last value from the stack and return it
      ' to the calling method. You're all done!
      mthdIL.Emit(OpCodes.Ret)
      
      
      ivType = ivTypeBld.CreateType()
      
      Return ivType
   End Function 'DynamicDotProductGen
    
   
   Public Shared Sub Main()
      
      Dim IVType As Type = Nothing
      Dim aVector1 As Object = Nothing
      Dim aVector2 As Object = Nothing
      Dim aVtypes() As Type = {GetType(Integer), GetType(Integer), GetType(Integer)}
      Dim aVargs1() As Object = {10, 10, 10}
      Dim aVargs2() As Object = {20, 20, 20}
      
      ' Call the  method to build our dynamic class.
      IVType = DynamicDotProductGen()
      
      
      Dim myDTctor As ConstructorInfo = IVType.GetConstructor(aVtypes)
      aVector1 = myDTctor.Invoke(aVargs1)
      aVector2 = myDTctor.Invoke(aVargs2)
      
      Console.WriteLine("---")
      Dim passMe(0) As Object
      passMe(0) = CType(aVector2, Object)
      
      Console.WriteLine("(10, 10, 10) . (20, 20, 20) = {0}", _
                        IVType.InvokeMember("DotProduct", BindingFlags.InvokeMethod, _
                        Nothing, aVector1, passMe))
   End Sub
End Class



' +++ OUTPUT +++
' ---
' (10, 10, 10) . (20, 20, 20) = 600

注釈

この API の詳細については、「 TypeBuilder の補足 API 解説」を参照してください。

コンストラクター

TypeBuilder()

TypeBuilder クラスの新しいインスタンスを初期化します。

フィールド

UnspecifiedTypeSize

この型の合計サイズが指定されていないことを表します。

プロパティ

Assembly

この型の定義を含む動的アセンブリを取得します。

AssemblyQualifiedName

アセンブリの表示名で修飾されたこの型の完全名を返します。

Attributes

実行時のクラスの新しいインスタンスを定義し、作成します。

Attributes

Type に関連付けられている属性を取得します。

(継承元 Type)
Attributes

実行時のクラスの新しいインスタンスを定義し、作成します。

(継承元 TypeInfo)
BaseType

この型の基本データ型を取得します。

ContainsGenericParameters

実行時のクラスの新しいインスタンスを定義し、作成します。

ContainsGenericParameters

現在の Type オブジェクトが特定の型で置き換えられていない型パラメーターを持っているかどうかを示す値を取得します。

(継承元 Type)
ContainsGenericParameters

実行時のクラスの新しいインスタンスを定義し、作成します。

(継承元 TypeInfo)
CustomAttributes

このメンバーのカスタム属性を含むコレクションを取得します。

(継承元 MemberInfo)
DeclaredConstructors

現在の型によって宣言されたコンストラクターのコレクションを取得します。

(継承元 TypeInfo)
DeclaredEvents

現在の型によって定義されたイベントのコレクションを取得します。

(継承元 TypeInfo)
DeclaredFields

現在の型によって定義されたフィールドのコレクションを取得します。

(継承元 TypeInfo)
DeclaredMembers

現在の型によって定義されたメンバーのコレクションを取得します。

(継承元 TypeInfo)
DeclaredMethods

現在の型によって定義されたメソッドのコレクションを取得します。

(継承元 TypeInfo)
DeclaredNestedTypes

現在の型によって定義された入れ子の型のコレクションを取得します。

(継承元 TypeInfo)
DeclaredProperties

現在の型によって定義されたプロパティのコレクションを取得します。

(継承元 TypeInfo)
DeclaringMethod

現在のジェネリック型パラメーターを宣言したメソッドを取得します。

DeclaringMethod

現在の MethodBase がジェネリック メソッドの型パラメーターを表している場合に、宣言するメソッドを表す Type を取得します。

(継承元 Type)
DeclaringType

この型を宣言した型を返します。

FullName

この型の完全なパスを取得します。

GenericParameterAttributes

現在のジェネリック型パラメーターの共変性および特殊な制約を示す値を取得します。

GenericParameterAttributes

現在のジェネリック型パラメーターの共変性および特殊な制約を説明する GenericParameterAttributes フラグの組み合わせを取得します。

(継承元 Type)
GenericParameterPosition

パラメーターを宣言するジェネリック型の型パラメーター リスト内の型パラメーターの位置を取得します。

GenericParameterPosition

Type オブジェクトがジェネリック型またはジェネリック メソッドの型パラメーターを表す場合に、パラメーターを宣言したジェネリック型またはジェネリック メソッドの型パラメーター リスト内の型パラメーターの位置を取得します。

(継承元 Type)
GenericTypeArguments

実行時のクラスの新しいインスタンスを定義し、作成します。

GenericTypeArguments

この型のジェネリック型引数の配列を取得します。

(継承元 Type)
GenericTypeArguments

実行時のクラスの新しいインスタンスを定義し、作成します。

(継承元 TypeInfo)
GenericTypeParameters

現在のインスタンスのジェネリック型パラメーターの配列を取得します。

(継承元 TypeInfo)
GUID

この型の GUID を取得します。

HasElementType

現在の Type が別の型を包含または参照しているかどうか、つまり現在の Type が配列、ポインター、または参照渡しかどうかを示す値を取得します。

(継承元 Type)
HasElementType

実行時のクラスの新しいインスタンスを定義し、作成します。

(継承元 TypeInfo)
ImplementedInterfaces

現在の型で実装されたインターフェイスのコレクションを取得します。

(継承元 TypeInfo)
IsAbstract

Type が抽象型で、オーバーライドする必要があるかどうかを示す値を取得します。

(継承元 Type)
IsAbstract

実行時のクラスの新しいインスタンスを定義し、作成します。

(継承元 TypeInfo)
IsAnsiClass

AnsiClass に、文字列書式属性として Type が選択されているかどうかを示す値を取得します。

(継承元 Type)
IsAnsiClass

実行時のクラスの新しいインスタンスを定義し、作成します。

(継承元 TypeInfo)
IsArray

型が配列かどうかを示す値を返します。

(継承元 Type)
IsArray

実行時のクラスの新しいインスタンスを定義し、作成します。

(継承元 TypeInfo)
IsAutoClass

AutoClass に、文字列書式属性として Type が選択されているかどうかを示す値を取得します。

(継承元 Type)
IsAutoClass

実行時のクラスの新しいインスタンスを定義し、作成します。

(継承元 TypeInfo)
IsAutoLayout

現在の型のフィールドが、共通言語ランタイムによって自動的に配置されているかどうかを示す値を取得します。

(継承元 Type)
IsAutoLayout

実行時のクラスの新しいインスタンスを定義し、作成します。

(継承元 TypeInfo)
IsByRef

Type が参照渡しかどうかを示す値を取得します。

(継承元 Type)
IsByRef

実行時のクラスの新しいインスタンスを定義し、作成します。

(継承元 TypeInfo)
IsByRefLike

型が byref に似た構造体であるかどうかを示す値を取得します。

IsByRefLike

型が byref に似た構造体であるかどうかを示す値を取得します。

(継承元 Type)
IsClass

Type がクラスまたはデリゲートである (つまり値型やインターフェイスではない) かどうかを示す値を取得します。

(継承元 Type)
IsClass

実行時のクラスの新しいインスタンスを定義し、作成します。

(継承元 TypeInfo)
IsCollectible

この MemberInfo オブジェクトが、収集可能な AssemblyLoadContext に保持されているアセンブリの一部であるかどうかを示す値を取得します。

(継承元 MemberInfo)
IsCOMObject

Type が COM オブジェクトかどうかを示す値を取得します。

(継承元 Type)
IsCOMObject

実行時のクラスの新しいインスタンスを定義し、作成します。

(継承元 TypeInfo)
IsConstructedGenericType

このオブジェクトが構築ジェネリック型かどうかを示す値を取得します。

IsConstructedGenericType

このオブジェクトが構築ジェネリック型かどうかを示す値を取得します。 構築ジェネリック型のインスタンスを作成できます。

(継承元 Type)
IsContextful

Type をコンテキスト内で管理できるかどうかを示す値を取得します。

(継承元 Type)
IsEnum

実行時のクラスの新しいインスタンスを定義し、作成します。

IsEnum

現在の Type が列挙体であるどうかを示す値を取得します。

(継承元 Type)
IsEnum

実行時のクラスの新しいインスタンスを定義し、作成します。

(継承元 TypeInfo)
IsExplicitLayout

現在の型のフィールドが、明示的に指定したオフセット位置に配置されているかどうかを示す値を取得します。

(継承元 Type)
IsExplicitLayout

実行時のクラスの新しいインスタンスを定義し、作成します。

(継承元 TypeInfo)
IsFunctionPointer

現在 Type の が関数ポインターであるかどうかを示す値を取得します。

(継承元 Type)
IsGenericMethodParameter

現在の Type が、ジェネリック メソッドの定義の型パラメーターを表すかどうかを示す値を取得します。

(継承元 Type)
IsGenericParameter

現在の型がジェネリック型パラメーターかどうかを示す値を取得します。

IsGenericParameter

現在の Type がジェネリック型またはジェネリック メソッドの定義の型パラメーターを表しているかどうかを示す値を取得します。

(継承元 Type)
IsGenericType

現在の型がジェネリック型かどうかを示す値を取得します。

IsGenericType

現在の型がジェネリック型かどうかを示す値を取得します。

(継承元 Type)
IsGenericTypeDefinition

現在の TypeBuilder が、他のジェネリック型を構築できるジェネリック型の定義を表しているかどうかを示す値を取得します。

IsGenericTypeDefinition

現在の Type が、他のジェネリック型を構築できるジェネリック型の定義を表しているかどうかを示す値を取得します。

(継承元 Type)
IsGenericTypeParameter

現在の Type が、ジェネリック型の定義の型パラメーターを表すかどうかを示す値を取得します。

(継承元 Type)
IsImport

TypeComImportAttribute 属性が適用されているかどうかを示す (つまり、COM タイプ ライブラリからインポートされたかどうかを示す) 値を取得します。

(継承元 Type)
IsImport

実行時のクラスの新しいインスタンスを定義し、作成します。

(継承元 TypeInfo)
IsInterface

Type がインターフェイスである (つまり値型やクラスではない) ことを示す値を取得します。

(継承元 Type)
IsInterface

実行時のクラスの新しいインスタンスを定義し、作成します。

(継承元 TypeInfo)
IsLayoutSequential

現在の型のフィールドが、定義済みまたはメタデータに対して出力された順序で、連続して配置されているかどうかを示す値を取得します。

(継承元 Type)
IsLayoutSequential

実行時のクラスの新しいインスタンスを定義し、作成します。

(継承元 TypeInfo)
IsMarshalByRef

Type が参照渡しでマーシャリングされるかどうかを示す値を取得します。

(継承元 Type)
IsMarshalByRef

実行時のクラスの新しいインスタンスを定義し、作成します。

(継承元 TypeInfo)
IsNested

現在の Type オブジェクトが、別の型の定義内に入れ子になっている定義で定義された型を表しているかどうかを示す値を取得します。

(継承元 Type)
IsNested

実行時のクラスの新しいインスタンスを定義し、作成します。

(継承元 TypeInfo)
IsNestedAssembly

Type が入れ子になっていて、それ自体が属するアセンブリ内でだけ参照可能かどうかを示す値を取得します。

(継承元 Type)
IsNestedAssembly

実行時のクラスの新しいインスタンスを定義し、作成します。

(継承元 TypeInfo)
IsNestedFamANDAssem

Type が入れ子になっていて、それ自体が属するファミリとアセンブリの両方に属しているクラスだけから参照可能かどうかを示す値を取得します。

(継承元 Type)
IsNestedFamANDAssem

実行時のクラスの新しいインスタンスを定義し、作成します。

(継承元 TypeInfo)
IsNestedFamily

Type が入れ子になっていて、それ自体が属するファミリ内でだけ参照可能かどうかを示す値を取得します。

(継承元 Type)
IsNestedFamily

実行時のクラスの新しいインスタンスを定義し、作成します。

(継承元 TypeInfo)
IsNestedFamORAssem

Type が入れ子になっていて、それ自体が属するファミリまたはアセンブリのいずれかに属しているクラスだけから参照可能かどうかを示す値を取得します。

(継承元 Type)
IsNestedFamORAssem

実行時のクラスの新しいインスタンスを定義し、作成します。

(継承元 TypeInfo)
IsNestedPrivate

Type が入れ子になっていて、プライベートとして宣言されているかどうかを示す値を取得します。

(継承元 Type)
IsNestedPrivate

実行時のクラスの新しいインスタンスを定義し、作成します。

(継承元 TypeInfo)
IsNestedPublic

クラスが入れ子になっていて、パブリックとして宣言されているかどうかを示す値を取得します。

(継承元 Type)
IsNestedPublic

実行時のクラスの新しいインスタンスを定義し、作成します。

(継承元 TypeInfo)
IsNotPublic

Type がパブリックとして宣言されていないかどうかを示す値を取得します。

(継承元 Type)
IsNotPublic

実行時のクラスの新しいインスタンスを定義し、作成します。

(継承元 TypeInfo)
IsPointer

Type がポインターかどうかを示す値を取得します。

(継承元 Type)
IsPointer

実行時のクラスの新しいインスタンスを定義し、作成します。

(継承元 TypeInfo)
IsPrimitive

Type がプリミティブ型の 1 つかどうかを示す値を取得します。

(継承元 Type)
IsPrimitive

実行時のクラスの新しいインスタンスを定義し、作成します。

(継承元 TypeInfo)
IsPublic

Type がパブリックとして宣言されているかどうかを示す値を取得します。

(継承元 Type)
IsPublic

実行時のクラスの新しいインスタンスを定義し、作成します。

(継承元 TypeInfo)
IsSealed

Type が sealed として宣言されているかどうかを示す値を取得します。

(継承元 Type)
IsSealed

実行時のクラスの新しいインスタンスを定義し、作成します。

(継承元 TypeInfo)
IsSecurityCritical

現在の型がセキュリティ クリティカルまたはセキュリティ セーフ クリティカルであり、重要な操作を実行できるかどうかを示す値を取得します。

IsSecurityCritical

現在の型が現在の信頼レベルでセキュリティ クリティカルまたはセキュリティ セーフ クリティカルであり、重要な操作を実行できるかどうかを示す値を取得します。

(継承元 Type)
IsSecuritySafeCritical

現在の型がセキュリティ セーフ クリティカルであり、重要な操作を実行でき、透過的なコードからアクセスできるかどうかを示す値を取得します。

IsSecuritySafeCritical

現在の型が現在の信頼レベルでセキュリティ セーフ クリティカルであり、重要な操作を実行でき、透過的なコードからアクセスできるかどうかを示す値を取得します。

(継承元 Type)
IsSecurityTransparent

現在の型が透過的であり、重要な操作を実行できないかどうかを示す値を取得します。

IsSecurityTransparent

現在の型が現在の信頼レベルで透過的であり、重要な操作を実行できないかどうかを示す値を取得します。

(継承元 Type)
IsSerializable

実行時のクラスの新しいインスタンスを定義し、作成します。

IsSerializable
古い.

がバイナリ シリアル化可能かどうかを示す値を Type 取得します。

(継承元 Type)
IsSerializable

実行時のクラスの新しいインスタンスを定義し、作成します。

(継承元 TypeInfo)
IsSignatureType

型が署名型かどうかを示す値を取得します。

(継承元 Type)
IsSpecialName

型が特別な処理を必要とする名前を持っているかどうかを示す値を取得します。

(継承元 Type)
IsSpecialName

実行時のクラスの新しいインスタンスを定義し、作成します。

(継承元 TypeInfo)
IsSZArray

実行時のクラスの新しいインスタンスを定義し、作成します。

IsSZArray

型が、下限が 0 の 1 次元配列のみを表すことができる配列型であるかどうかを示す値を取得します。

(継承元 Type)
IsTypeDefinition

実行時のクラスの新しいインスタンスを定義し、作成します。

IsTypeDefinition

型が型定義かどうかを示す値を取得します。

(継承元 Type)
IsUnicodeClass

UnicodeClass に、文字列書式属性として Type が選択されているかどうかを示す値を取得します。

(継承元 Type)
IsUnicodeClass

実行時のクラスの新しいインスタンスを定義し、作成します。

(継承元 TypeInfo)
IsUnmanagedFunctionPointer

現在 Type の がアンマネージ関数ポインターであるかどうかを示す値を取得します。

(継承元 Type)
IsValueType

Type が値型かどうかを示す値を取得します。

(継承元 Type)
IsValueType

実行時のクラスの新しいインスタンスを定義し、作成します。

(継承元 TypeInfo)
IsVariableBoundArray

実行時のクラスの新しいインスタンスを定義し、作成します。

IsVariableBoundArray

型が多次元配列を表すことができるか、任意の下限を持つ 1 つの配列を表すことができる配列型であるかどうかを示す値を取得します。

(継承元 Type)
IsVisible

Type にアセンブリの外側のコードからアクセスできるかどうかを示す値を取得します。

(継承元 Type)
IsVisible

実行時のクラスの新しいインスタンスを定義し、作成します。

(継承元 TypeInfo)
MemberType

このメンバーが型であるか、または入れ子にされた型であるかを示す MemberTypes 値を取得します。

(継承元 Type)
MemberType

実行時のクラスの新しいインスタンスを定義し、作成します。

(継承元 TypeInfo)
MetadataToken

メタデータ内の現在の動的モジュールを識別するトークンを取得します。

MetadataToken

メタデータ要素を識別する値を取得します。

(継承元 MemberInfo)
Module

この型定義を含む動的モジュールを取得します。

Name

この型の名前を取得します。

Namespace

この TypeBuilder が定義されている名前空間を取得します。

PackingSize

この型のパッキング サイズを取得します。

PackingSizeCore

派生クラスでオーバーライドされると、この型のパッキング サイズを取得します。

ReflectedType

この型を取得するために使用された型を返します。

ReflectedType

MemberInfo のこのインスタンスを取得するために使用したクラス オブジェクトを取得します。

(継承元 MemberInfo)
Size

型の合計サイズを取得します。

SizeCore

派生クラスでオーバーライドされると、型の合計サイズを取得します。

StructLayoutAttribute

現在の型のレイアウトを説明する StructLayoutAttribute を取得します。

(継承元 Type)
StructLayoutAttribute

実行時のクラスの新しいインスタンスを定義し、作成します。

(継承元 TypeInfo)
TypeHandle

動的モジュールではサポートされていません。

TypeInitializer

型の初期化子を取得します。

(継承元 Type)
TypeInitializer

実行時のクラスの新しいインスタンスを定義し、作成します。

(継承元 TypeInfo)
TypeToken

この型の型トークンを返します。

UnderlyingSystemType

この TypeBuilder の基になるシステム型を返します。

UnderlyingSystemType

実行時のクラスの新しいインスタンスを定義し、作成します。

(継承元 TypeInfo)

メソッド

AddDeclarativeSecurity(SecurityAction, PermissionSet)

この型に宣言セキュリティを追加します。

AddInterfaceImplementation(Type)

この型が実装するインターフェイスを追加します。

AddInterfaceImplementationCore(Type)

派生クラスでオーバーライドされると、この型が実装するインターフェイスが追加されます。

AsType()

現在の型を Type オブジェクトとして返します。

(継承元 TypeInfo)
CreateType()

クラスの Type オブジェクトを作成します。 フィールドおよびメソッドをクラスで定義した後、Type オブジェクトを読みこむために CreateType が呼び出されます。

CreateTypeInfo()

この型を表す TypeInfo オブジェクトを取得します。

CreateTypeInfoCore()

派生クラスでオーバーライドされると、この型を TypeInfo 表す オブジェクトを取得します。

DefineConstructor(MethodAttributes, CallingConventions, Type[])

型に、指定した属性およびシグネチャの新しいコンストラクターを追加します。

DefineConstructor(MethodAttributes, CallingConventions, Type[], Type[][], Type[][])

指定された属性、署名、およびカスタム修飾子で、型に新しいコンストラクターを追加します。

DefineConstructorCore(MethodAttributes, CallingConventions, Type[], Type[][], Type[][])

派生クラスでオーバーライドされた場合は、指定された属性、シグネチャ、およびカスタム修飾子を使用して、新しいコンストラクターを 型に追加します。

DefineDefaultConstructor(MethodAttributes)

パラメーターなしのコンストラクターを定義します。 ここで定義されたコンストラクターは、単に親のパラメーターなしのコンストラクターを呼び出します。

DefineDefaultConstructorCore(MethodAttributes)

派生クラスでオーバーライドされた場合、パラメーターなしのコンストラクターを定義します。 ここで定義されているコンストラクターは、親のパラメーターなしのコンストラクターを呼び出します。

DefineEvent(String, EventAttributes, Type)

指定した名前、属性、イベント型の新しいイベントを型に追加します。

DefineEventCore(String, EventAttributes, Type)

派生クラスでオーバーライドされた場合は、指定された名前、属性、およびイベント型を使用して、新しいイベントを 型に追加します。

DefineField(String, Type, FieldAttributes)

指定した名前、属性、フィールド型の新しいフィールドを型に追加します。

DefineField(String, Type, Type[], Type[], FieldAttributes)

指定された名前、属性、フィールドの種類、およびカスタム修飾子を持つ新しいフィールドを型に追加します。

DefineFieldCore(String, Type, Type[], Type[], FieldAttributes)

派生クラスでオーバーライドされると、指定された名前、属性、フィールド型、およびカスタム修飾子を使用して、新しいフィールドが型に追加されます。

DefineGenericParameters(String[])

現在の型のジェネリック型パラメーターを定義してその数と名前を指定し、それらの制約の設定に使用できる GenericTypeParameterBuilder オブジェクトの配列を返します。

DefineGenericParametersCore(String[])

派生クラスでオーバーライドされた場合、現在の型のジェネリック型パラメーターを定義し、その数値とその名前を指定します。

DefineInitializedData(String, Byte[], FieldAttributes)

ポータブル実行可能 (PE) ファイルの .sdata セクションの初期化済みデータ フィールドを定義します。

DefineInitializedDataCore(String, Byte[], FieldAttributes)

派生クラスでオーバーライドされた場合、ポータブル実行可能ファイル (PE) ファイルの .sdata セクションで初期化されたデータ フィールドを定義します。

DefineMethod(String, MethodAttributes)

新しいメソッドを、指定された名前とメソッドの属性を持つ型に追加します。

DefineMethod(String, MethodAttributes, CallingConventions)

新しいメソッドを、指定された名前、メソッドの属性、および呼び出し規約を持つ型に追加します。

DefineMethod(String, MethodAttributes, CallingConventions, Type, Type[])

指定された名前、メソッドの属性、呼び出し規則、およびメソッドのシグネチャを持つ新しいメソッドを型に追加します。

DefineMethod(String, MethodAttributes, CallingConventions, Type, Type[], Type[], Type[], Type[][], Type[][])

新しいメソッドを、指定された名前、メソッドの属性、呼び出し規則、メソッドのシグニチャ、およびカスタム修飾子を持つ型に追加します。

DefineMethod(String, MethodAttributes, Type, Type[])

新しいメソッドを、指定された名前、メソッドの属性、およびメソッドのシグニチャを持つ型に追加します。

DefineMethodCore(String, MethodAttributes, CallingConventions, Type, Type[], Type[], Type[], Type[][], Type[][])

派生クラスでオーバーライドされた場合、指定した名前、メソッド属性、呼び出し規約、メソッド シグネチャ、およびカスタム修飾子を使用して、新しいメソッドを 型に追加します。

DefineMethodOverride(MethodInfo, MethodInfo)

特定のメソッド宣言 (名前が異なる可能性があります) を実装する特定のメソッド本体を指定します。

DefineMethodOverrideCore(MethodInfo, MethodInfo)

派生クラスでオーバーライドされた場合、特定のメソッド宣言を実装する特定のメソッド本体を指定します。名前が異なる可能性があります。

DefineNestedType(String)

名前を指定された、入れ子にされた型を定義します。

DefineNestedType(String, TypeAttributes)

指定した名前と属性を持つ入れ子にされた型を定義します。

DefineNestedType(String, TypeAttributes, Type)

入れ子にされた型、指定された名前、属性、および拡張する型を定義します。

DefineNestedType(String, TypeAttributes, Type, Int32)

入れ子にされた型、指定された名前、属性、型の合計サイズ、および拡張する型を定義します。

DefineNestedType(String, TypeAttributes, Type, PackingSize)

入れ子にされた型、指定された名前、属性、拡張する型、およびパッキング サイズを定義します。

DefineNestedType(String, TypeAttributes, Type, PackingSize, Int32)

入れ子にされた型、指定された名前、属性、サイズ、および拡張する型を定義します。

DefineNestedType(String, TypeAttributes, Type, Type[])

指定された名前、属性、拡張する基本型、および実装するインターフェイスを指定して、ネスト型を定義します。

DefineNestedTypeCore(String, TypeAttributes, Type, Type[], PackingSize, Int32)

派生クラスでオーバーライドされた場合、名前、属性、サイズ、および拡張する型を指定して、入れ子になった型を定義します。

DefinePInvokeMethod(String, String, MethodAttributes, CallingConventions, Type, Type[], CallingConvention, CharSet)

PInvoke メソッドに名前を指定して、メソッドが定義されている DLL の名前、メソッドの属性、メソッドの呼び出し規則、メソッドの戻り値の型、メソッドのパラメーター型、および PInvoke フラグを定義します。

DefinePInvokeMethod(String, String, String, MethodAttributes, CallingConventions, Type, Type[], CallingConvention, CharSet)

PInvoke メソッドに名前を指定して、メソッドが定義されている DLL の名前、エントリ ポイント名、メソッドの属性、メソッドの呼び出し規約、メソッドの戻り値の型、メソッドのパラメーター型、および PInvoke フラグを定義します。

DefinePInvokeMethod(String, String, String, MethodAttributes, CallingConventions, Type, Type[], Type[], Type[], Type[][], Type[][], CallingConvention, CharSet)

PInvoke メソッドを定義します。名前、メソッドが定義されている DLL の名前、エントリ ポイント名、メソッドの属性、メソッドの呼び出し規則、メソッドの戻り値の型、メソッドのパラメーター型、PInvoke フラグ、およびパラメーターと戻り値の型のカスタム修飾子を指定します。

DefinePInvokeMethodCore(String, String, String, MethodAttributes, CallingConventions, Type, Type[], Type[], Type[], Type[][], Type[][], CallingConvention, CharSet)

派生クラスでオーバーライドされた場合、指定された名前、DLL 名、エントリ ポイント名、属性、呼び出し規約、戻り値の型、パラメーターの型、PInvoke フラグ、およびパラメーターと戻り値の型のカスタム修飾子を使用して PInvoke メソッドを定義します。

DefineProperty(String, PropertyAttributes, CallingConventions, Type, Type[])

新しいプロパティを、指定された名前、属性、呼び出し規則、およびプロパティの署名を持つ型に追加します。

DefineProperty(String, PropertyAttributes, CallingConventions, Type, Type[], Type[], Type[], Type[][], Type[][])

指定された名前、呼び出し規則、プロパティの署名、およびカスタム修飾子を使用して、新しいプロパティを型に追加します。

DefineProperty(String, PropertyAttributes, Type, Type[])

指定された名前とプロパティのシグネチャにより、新しいプロパティを型に追加します。

DefineProperty(String, PropertyAttributes, Type, Type[], Type[], Type[], Type[][], Type[][])

指定された名前、プロパティのシグネチャ、およびカスタム修飾子により、新しいプロパティを型に追加します。

DefinePropertyCore(String, PropertyAttributes, CallingConventions, Type, Type[], Type[], Type[], Type[][], Type[][])

派生クラスでオーバーライドされた場合、指定された名前、呼び出し規約、プロパティシグネチャ、およびカスタム修飾子を使用して、新しいプロパティを型に追加します。

DefineTypeInitializer()

この型の初期化子を定義します。

DefineTypeInitializerCore()

派生クラスでオーバーライドされると、この型の初期化子が定義されます。

DefineUninitializedData(String, Int32, FieldAttributes)

ポータブル実行可能 (PE) ファイルの .sdata セクションの初期化されていないデータ フィールドを定義します。

DefineUninitializedDataCore(String, Int32, FieldAttributes)

派生クラスでオーバーライドされた場合、ポータブル実行可能ファイル (PE) ファイルの セクションで .sdata 初期化されていないデータ フィールドを定義します。

Equals(Object)

現在の Type オブジェクトの基になるシステム型が、指定した Object の基になるシステム型と同じかどうかを判断します。

(継承元 Type)
Equals(Object)

このインスタンスが、指定されたオブジェクトと等価であるかどうかを示す値を返します。

(継承元 MemberInfo)
Equals(Type)

現在の Type の基になるシステム型が、指定した Type の基になるシステム型と同じかどうかを判断します。

(継承元 Type)
FindInterfaces(TypeFilter, Object)

現在の Type によって実装または継承されているインターフェイスのフィルター適用済みリストを表す、Type オブジェクトの配列を返します。

(継承元 Type)
FindInterfaces(TypeFilter, Object)

実行時のクラスの新しいインスタンスを定義し、作成します。

(継承元 TypeInfo)
FindMembers(MemberTypes, BindingFlags, MemberFilter, Object)

指定したメンバー型の MemberInfo オブジェクトの配列にフィルターを適用して返します。

(継承元 Type)
FindMembers(MemberTypes, BindingFlags, MemberFilter, Object)

実行時のクラスの新しいインスタンスを定義し、作成します。

(継承元 TypeInfo)
GetArrayRank()

実行時のクラスの新しいインスタンスを定義し、作成します。

GetArrayRank()

配列の次元数を取得します。

(継承元 Type)
GetArrayRank()

実行時のクラスの新しいインスタンスを定義し、作成します。

(継承元 TypeInfo)
GetAttributeFlagsImpl()

派生クラスでオーバーライドされた場合、Attributes プロパティを実装し、Type に関連付けられている属性を示す列挙値のビットごとの組み合わせを取得します。

GetAttributeFlagsImpl()

派生クラスでオーバーライドされた場合、Attributes プロパティを実装し、Type に関連付けられている属性を示す列挙値のビットごとの組み合わせを取得します。

(継承元 Type)
GetConstructor(BindingFlags, Binder, CallingConventions, Type[], ParameterModifier[])

指定したバインディング制約および指定した呼び出し規則を使用して、指定した引数の型および修飾子と一致するパラメーターが設定されているコンストラクターを検索します。

(継承元 Type)
GetConstructor(BindingFlags, Binder, Type[], ParameterModifier[])

指定したバインディング制約を使用して、指定した引数の型および修飾子と一致するパラメーターが設定されているコンストラクターを検索します。

(継承元 Type)
GetConstructor(BindingFlags, Type[])

指定したバインド制約を使用して、指定した引数の型と一致するパラメーターを持つコンストラクターを検索します。

(継承元 Type)
GetConstructor(Type, ConstructorInfo)

ジェネリック型定義の指定されたコンストラクターに対応する、指定の構築されたジェネリック型のコンストラクターを返します。

GetConstructor(Type[])

指定した配列の型に一致するパラメーターが設定されているパブリック インスタンス コンストラクターを検索します。

(継承元 Type)
GetConstructor(Type[])

実行時のクラスの新しいインスタンスを定義し、作成します。

(継承元 TypeInfo)
GetConstructorImpl(BindingFlags, Binder, CallingConventions, Type[], ParameterModifier[])

派生クラスによってオーバーライドされた場合、指定したバインディング制約および指定した呼び出し規約を使用して、指定した引数の型および修飾子と一致するパラメーターが設定されているコンストラクターを検索します。

GetConstructorImpl(BindingFlags, Binder, CallingConventions, Type[], ParameterModifier[])

派生クラスによってオーバーライドされた場合、指定したバインディング制約および指定した呼び出し規約を使用して、指定した引数の型および修飾子と一致するパラメーターが設定されているコンストラクターを検索します。

(継承元 Type)
GetConstructors()

現在の Type に対して定義されているパブリック コンストラクターをすべて返します。

(継承元 Type)
GetConstructors()

実行時のクラスの新しいインスタンスを定義し、作成します。

(継承元 TypeInfo)
GetConstructors(BindingFlags)

指定に従って、このクラスに定義されているパブリック コンストラクターおよび非パブリック コンストラクターを表す ConstructorInfo オブジェクトの配列を返します。

GetConstructors(BindingFlags)

実行時のクラスの新しいインスタンスを定義し、作成します。

(継承元 TypeInfo)
GetCustomAttributes(Boolean)

この型の定義済みのカスタム属性をすべて返します。

GetCustomAttributes(Boolean)

派生クラスでオーバーライドされた場合、このメンバーに適用されているすべてのカスタム属性の配列を返します。

(継承元 MemberInfo)
GetCustomAttributes(Type, Boolean)

現在の型のカスタム属性のうち、指定された型に代入可能なものすべてを返します。

GetCustomAttributes(Type, Boolean)

派生クラスでオーバーライドされた場合は、このメンバーに適用され、Type によって識別されるカスタム属性の配列を返します。

(継承元 MemberInfo)
GetCustomAttributesData()

ターゲット メンバーに適用されている属性に関するデータを表す CustomAttributeData オブジェクトのリストを返します。

(継承元 MemberInfo)
GetDeclaredEvent(String)

現在の型によって宣言された指定されたイベントを表す オブジェクトを返します。

(継承元 TypeInfo)
GetDeclaredField(String)

現在の型によって宣言された指定されたフィールドを表す オブジェクトを返します。

(継承元 TypeInfo)
GetDeclaredMethod(String)

現在の型によって宣言された指定されたメソッドを表す オブジェクトを返します。

(継承元 TypeInfo)
GetDeclaredMethods(String)

指定した名前に一致する現在の型で宣言されたすべてのメソッドを含むコレクションを返します。

(継承元 TypeInfo)
GetDeclaredNestedType(String)

現在の型によって宣言された、指定した入れ子になった型を表す オブジェクトを返します。

(継承元 TypeInfo)
GetDeclaredProperty(String)

現在の型によって宣言された指定されたプロパティを表す オブジェクトを返します。

(継承元 TypeInfo)
GetDefaultMembers()

Type が設定されている現在の DefaultMemberAttribute に定義されているメンバーを検索します。

(継承元 Type)
GetDefaultMembers()

実行時のクラスの新しいインスタンスを定義し、作成します。

(継承元 TypeInfo)
GetElementType()

このメソッドを呼び出すと、必ず NotSupportedException がスローされます。

GetEnumName(Object)

現在の列挙型の指定された値を持つ定数の名前を返します。

(継承元 Type)
GetEnumName(Object)

実行時のクラスの新しいインスタンスを定義し、作成します。

(継承元 TypeInfo)
GetEnumNames()

現在の列挙型のメンバーの名前を返します。

(継承元 Type)
GetEnumNames()

実行時のクラスの新しいインスタンスを定義し、作成します。

(継承元 TypeInfo)
GetEnumUnderlyingType()

現在の列挙型の基になる型を返します。

(継承元 Type)
GetEnumUnderlyingType()

実行時のクラスの新しいインスタンスを定義し、作成します。

(継承元 TypeInfo)
GetEnumValues()

現在の列挙型の定数の値の配列を返します。

(継承元 Type)
GetEnumValues()

実行時のクラスの新しいインスタンスを定義し、作成します。

(継承元 TypeInfo)
GetEnumValuesAsUnderlyingType()

この列挙型の基になる型定数の値の配列を取得します。

(継承元 Type)
GetEvent(String)

指定したパブリック イベントを表す EventInfo オブジェクトを返します。

(継承元 Type)
GetEvent(String)

実行時のクラスの新しいインスタンスを定義し、作成します。

(継承元 TypeInfo)
GetEvent(String, BindingFlags)

指定した名前のイベントを返します。

GetEvent(String, BindingFlags)

実行時のクラスの新しいインスタンスを定義し、作成します。

(継承元 TypeInfo)
GetEvents()

この型で宣言または継承されているパブリック イベントを返します。

GetEvents()

実行時のクラスの新しいインスタンスを定義し、作成します。

(継承元 TypeInfo)
GetEvents(BindingFlags)

この型で宣言されているパブリック イベントとパブリックでないイベントを返します。

GetEvents(BindingFlags)

実行時のクラスの新しいインスタンスを定義し、作成します。

(継承元 TypeInfo)
GetField(String)

指定した名前のパブリック フィールドを検索します。

(継承元 Type)
GetField(String)

実行時のクラスの新しいインスタンスを定義し、作成します。

(継承元 TypeInfo)
GetField(String, BindingFlags)

指定した名前で指定されたフィールドを返します。

GetField(String, BindingFlags)

実行時のクラスの新しいインスタンスを定義し、作成します。

(継承元 TypeInfo)
GetField(Type, FieldInfo)

ジェネリック型定義の指定されたフィールドに対応する、指定の構築されたジェネリック型のフィールドを返します。

GetFields()

現在の Type のすべてのパブリック フィールドを返します。

(継承元 Type)
GetFields()

実行時のクラスの新しいインスタンスを定義し、作成します。

(継承元 TypeInfo)
GetFields(BindingFlags)

この型で宣言されているパブリック フィールドとパブリックでないフィールドを返します。

GetFields(BindingFlags)

実行時のクラスの新しいインスタンスを定義し、作成します。

(継承元 TypeInfo)
GetFunctionPointerCallingConventions()

派生クラスでオーバーライドされると、現在の関数ポインター の呼び出し規則を返します Type

(継承元 Type)
GetFunctionPointerParameterTypes()

派生クラスでオーバーライドされると、現在の関数ポインター のパラメーター型を返します Type

(継承元 Type)
GetFunctionPointerReturnType()

派生クラスでオーバーライドされると、現在の関数ポインター の戻り値の型を返します Type

(継承元 Type)
GetGenericArguments()

ジェネリック型の型引数またはジェネリック型定義の型パラメーターを表す Type オブジェクトの配列を返します。

GetGenericArguments()

クローズ ジェネリック型の型引数またはジェネリック型定義の型パラメーターを表す Type オブジェクトの配列を返します。

(継承元 Type)
GetGenericArguments()

実行時のクラスの新しいインスタンスを定義し、作成します。

(継承元 TypeInfo)
GetGenericParameterConstraints()

実行時のクラスの新しいインスタンスを定義し、作成します。

GetGenericParameterConstraints()

現在のジェネリック型パラメーターの制約を表す Type オブジェクトの配列を返します。

(継承元 Type)
GetGenericParameterConstraints()

実行時のクラスの新しいインスタンスを定義し、作成します。

(継承元 TypeInfo)
GetGenericTypeDefinition()

現在の型を取得する元になるジェネリック型定義を表す Type オブジェクトを返します。

GetGenericTypeDefinition()

現在のジェネリック型を構築する元になるジェネリック型定義を表す Type オブジェクトを返します。

(継承元 Type)
GetHashCode()

このインスタンスのハッシュ コードを返します。

(継承元 Type)
GetHashCode()

このインスタンスのハッシュ コードを返します。

(継承元 MemberInfo)
GetInterface(String)

指定した名前のインターフェイスを検索します。

(継承元 Type)
GetInterface(String)

実行時のクラスの新しいインスタンスを定義し、作成します。

(継承元 TypeInfo)
GetInterface(String, Boolean)

指定されたインターフェイス名に一致する完全修飾名を名前とする、このクラスによって (直接的または間接的に) 実装されるインターフェイスを返します。

GetInterface(String, Boolean)

実行時のクラスの新しいインスタンスを定義し、作成します。

(継承元 TypeInfo)
GetInterfaceMap(Type)

要求されたインターフェイスに対するインターフェイス マップを返します。

GetInterfaces()

この型とその基本型に実装されているすべてのインターフェイスの配列を返します。

GetInterfaces()

実行時のクラスの新しいインスタンスを定義し、作成します。

(継承元 TypeInfo)
GetMember(String)

指定した名前のパブリック メンバーを検索します。

(継承元 Type)
GetMember(String)

実行時のクラスの新しいインスタンスを定義し、作成します。

(継承元 TypeInfo)
GetMember(String, BindingFlags)

指定したバインディング制約を使用して、指定したメンバーを検索します。

(継承元 Type)
GetMember(String, BindingFlags)

実行時のクラスの新しいインスタンスを定義し、作成します。

(継承元 TypeInfo)
GetMember(String, MemberTypes, BindingFlags)

指定のとおりに、この型によって宣言または継承されたパブリック メンバーと非パブリック メンバーをすべて返します。

GetMember(String, MemberTypes, BindingFlags)

実行時のクラスの新しいインスタンスを定義し、作成します。

(継承元 TypeInfo)
GetMembers()

現在の Type のすべてのパブリック メンバーを返します。

(継承元 Type)
GetMembers()

実行時のクラスの新しいインスタンスを定義し、作成します。

(継承元 TypeInfo)
GetMembers(BindingFlags)

この型によって宣言または継承されたパブリック メンバーと非パブリック メンバーをすべて返します。

GetMembers(BindingFlags)

実行時のクラスの新しいインスタンスを定義し、作成します。

(継承元 TypeInfo)
GetMemberWithSameMetadataDefinitionAs(MemberInfo)

指定した MemberInfoMemberInfo一致する現在Typeの で を検索します。

(継承元 Type)
GetMethod(String)

指定した名前のパブリック メソッドを検索します。

(継承元 Type)
GetMethod(String)

実行時のクラスの新しいインスタンスを定義し、作成します。

(継承元 TypeInfo)
GetMethod(String, BindingFlags)

指定したバインディング制約を使用して、指定したメソッドを検索します。

(継承元 Type)
GetMethod(String, BindingFlags)

実行時のクラスの新しいインスタンスを定義し、作成します。

(継承元 TypeInfo)
GetMethod(String, BindingFlags, Binder, CallingConventions, Type[], ParameterModifier[])

指定したバインディング制約および指定した呼び出し規約を使用して、指定したメソッドのうち、指定した引数の型および修飾子と一致するパラメーターが設定されているものを検索します。

(継承元 Type)
GetMethod(String, BindingFlags, Binder, Type[], ParameterModifier[])

指定したバインディング制約を使用して、指定したメソッドのうち、指定した引数の型および修飾子と一致するパラメーターが設定されているものを検索します。

(継承元 Type)
GetMethod(String, BindingFlags, Type[])

指定したバインディング制約を使用して、指定した引数の型と一致するパラメーターを持つ指定したメソッドを検索します。

(継承元 Type)
GetMethod(String, Int32, BindingFlags, Binder, CallingConventions, Type[], ParameterModifier[])

指定したバインディング制約および指定した呼び出し規約を使用して、指定したメソッドのうち、指定したジェネリック パラメーターの数、引数の型、および修飾子と一致するパラメーターが設定されているものを検索します。

(継承元 Type)
GetMethod(String, Int32, BindingFlags, Binder, Type[], ParameterModifier[])

指定したバインディング制約を使用して、指定したメソッドのうち、指定したジェネリック パラメーターの数、引数の型、および修飾子と一致するパラメーターが設定されているものを検索します。

(継承元 Type)
GetMethod(String, Int32, BindingFlags, Type[])

実行時のクラスの新しいインスタンスを定義し、作成します。

(継承元 Type)
GetMethod(String, Int32, Type[])

指定したジェネリック パラメーターの数と引数の型に一致するパラメーターを持つ、指定したパブリック メソッドを検索します。

(継承元 Type)
GetMethod(String, Int32, Type[], ParameterModifier[])

指定したジェネリック パラメーターの数、引数の型、および修飾子に一致するパラメーターを持つ、指定したパブリック メソッドを検索します。

(継承元 Type)
GetMethod(String, Type[])

指定したパブリック メソッドのうち、指定した引数型と一致するパラメーターが設定されているものを検索します。

(継承元 Type)
GetMethod(String, Type[])

実行時のクラスの新しいインスタンスを定義し、作成します。

(継承元 TypeInfo)
GetMethod(String, Type[], ParameterModifier[])

指定したパブリック メソッドのうち、指定した引数の型および修飾子と一致するパラメーターが設定されているものを検索します。

(継承元 Type)
GetMethod(String, Type[], ParameterModifier[])

実行時のクラスの新しいインスタンスを定義し、作成します。

(継承元 TypeInfo)
GetMethod(Type, MethodInfo)

ジェネリック型定義の指定されたメソッドに対応する、指定の構築されたジェネリック型のメソッドを返します。

GetMethodImpl(String, BindingFlags, Binder, CallingConventions, Type[], ParameterModifier[])

派生クラスによってオーバーライドされた場合、指定したバインディング制約および指定した呼び出し規則を使用して、指定したメソッドのうち、指定した引数の型および修飾子と一致するパラメーターが設定されているものを検索します。

GetMethodImpl(String, BindingFlags, Binder, CallingConventions, Type[], ParameterModifier[])

派生クラスによってオーバーライドされた場合、指定したバインディング制約および指定した呼び出し規則を使用して、指定したメソッドのうち、指定した引数の型および修飾子と一致するパラメーターが設定されているものを検索します。

(継承元 Type)
GetMethodImpl(String, Int32, BindingFlags, Binder, CallingConventions, Type[], ParameterModifier[])

派生クラスによってオーバーライドされた場合、指定したバインディング制約および指定した呼び出し規則を使用して、指定したメソッドのうち、指定したジェネリック パラメーターの数、引数の型、修飾子と一致するパラメーターが設定されているものを検索します。

(継承元 Type)
GetMethods()

現在の Type のすべてのパブリック メソッドを返します。

(継承元 Type)
GetMethods()

実行時のクラスの新しいインスタンスを定義し、作成します。

(継承元 TypeInfo)
GetMethods(BindingFlags)

指定のとおりに、この型によって宣言または継承されたパブリック メソッドと非パブリック メソッドをすべて返します。

GetMethods(BindingFlags)

実行時のクラスの新しいインスタンスを定義し、作成します。

(継承元 TypeInfo)
GetNestedType(String)

指定した名前を持ち、入れ子にされたパブリックな型を検索します。

(継承元 Type)
GetNestedType(String)

実行時のクラスの新しいインスタンスを定義し、作成します。

(継承元 TypeInfo)
GetNestedType(String, BindingFlags)

この型によって宣言されている、入れ子にされたパブリック型とパブリックでない型を返します。

GetNestedType(String, BindingFlags)

実行時のクラスの新しいインスタンスを定義し、作成します。

(継承元 TypeInfo)
GetNestedTypes()

現在の Type 内で入れ子になっているすべてのパブリック型を返します。

(継承元 Type)
GetNestedTypes()

実行時のクラスの新しいインスタンスを定義し、作成します。

(継承元 TypeInfo)
GetNestedTypes(BindingFlags)

この型で宣言または継承されている入れ子にされたパブリック型とパブリックでない型を返します。

GetNestedTypes(BindingFlags)

実行時のクラスの新しいインスタンスを定義し、作成します。

(継承元 TypeInfo)
GetOptionalCustomModifiers()

派生クラスでオーバーライドされると、現在 Typeの の省略可能なカスタム修飾子を返します。

(継承元 Type)
GetProperties()

現在の Type のすべてのパブリック プロパティを返します。

(継承元 Type)
GetProperties()

実行時のクラスの新しいインスタンスを定義し、作成します。

(継承元 TypeInfo)
GetProperties(BindingFlags)

指定のとおりに、この型によって宣言または継承されたパブリック プロパティと非パブリック プロパティをすべて返します。

GetProperties(BindingFlags)

実行時のクラスの新しいインスタンスを定義し、作成します。

(継承元 TypeInfo)
GetProperty(String)

指定した名前のパブリック プロパティを検索します。

(継承元 Type)
GetProperty(String)

実行時のクラスの新しいインスタンスを定義し、作成します。

(継承元 TypeInfo)
GetProperty(String, BindingFlags)

指定されたバインディング制約を使用して、指定されたプロパティを検索します。

(継承元 Type)
GetProperty(String, BindingFlags)

実行時のクラスの新しいインスタンスを定義し、作成します。

(継承元 TypeInfo)
GetProperty(String, BindingFlags, Binder, Type, Type[], ParameterModifier[])

指定したバインディング制約を使用して、指定した引数の型および修飾子と一致するパラメーターが設定された指定のプロパティを検索します。

(継承元 Type)
GetProperty(String, Type)

指定した名前および戻り値の型を持つパブリック プロパティを検索します。

(継承元 Type)
GetProperty(String, Type)

実行時のクラスの新しいインスタンスを定義し、作成します。

(継承元 TypeInfo)
GetProperty(String, Type, Type[])

指定したパブリック プロパティのうち、指定した引数型と一致するパラメーターが設定されているものを検索します。

(継承元 Type)
GetProperty(String, Type, Type[])

実行時のクラスの新しいインスタンスを定義し、作成します。

(継承元 TypeInfo)
GetProperty(String, Type, Type[], ParameterModifier[])

指定したパブリック プロパティのうち、指定した引数の型および修飾子と一致するパラメーターが設定されているものを検索します。

(継承元 Type)
GetProperty(String, Type, Type[], ParameterModifier[])

実行時のクラスの新しいインスタンスを定義し、作成します。

(継承元 TypeInfo)
GetProperty(String, Type[])

指定したパブリック プロパティのうち、指定した引数型と一致するパラメーターが設定されているものを検索します。

(継承元 Type)
GetProperty(String, Type[])

実行時のクラスの新しいインスタンスを定義し、作成します。

(継承元 TypeInfo)
GetPropertyImpl(String, BindingFlags, Binder, Type, Type[], ParameterModifier[])

派生クラスによってオーバーライドされるときに、指定のバインディング制約を使用して、指定した引数の型および修飾子と一致するパラメーターが設定されたプロパティを検索します。

GetPropertyImpl(String, BindingFlags, Binder, Type, Type[], ParameterModifier[])

派生クラスによってオーバーライドされるときに、指定のバインディング制約を使用して、指定した引数の型および修飾子と一致するパラメーターが設定されたプロパティを検索します。

(継承元 Type)
GetRequiredCustomModifiers()

派生クラスでオーバーライドされると、現在 Typeの の必要なカスタム修飾子を返します。

(継承元 Type)
GetType()

現在の Type を取得します。

(継承元 Type)
GetType()

メンバーの属性を取得し、メンバーのメタデータにアクセスできるようにします。

(継承元 MemberInfo)
GetTypeCodeImpl()

この Type インスタンスの基になる型コードを返します。

(継承元 Type)
HasElementTypeImpl()

派生クラスによってオーバーライドされた場合、HasElementType プロパティを実装し、現在の Type が別の型を包含または参照しているかどうか、つまり現在の Type が配列やポインターであるか、参照渡しかどうかを判断します。

HasElementTypeImpl()

派生クラスによってオーバーライドされた場合、HasElementType プロパティを実装し、現在の Type が別の型を包含または参照しているかどうか、つまり現在の Type が配列やポインターであるか、参照渡しかどうかを判断します。

(継承元 Type)
HasSameMetadataDefinitionAs(MemberInfo)

実行時のクラスの新しいインスタンスを定義し、作成します。

(継承元 MemberInfo)
InvokeMember(String, BindingFlags, Binder, Object, Object[])

指定したバインディング制約を使用し、指定した引数リストと照合して、指定したメンバーを呼び出します。

(継承元 Type)
InvokeMember(String, BindingFlags, Binder, Object, Object[], CultureInfo)

指定したバインディング制約を使用し、指定したメンバーのうち、指定した引数リストおよびカルチャと一致するメンバーを呼び出します。

(継承元 Type)
InvokeMember(String, BindingFlags, Binder, Object, Object[], ParameterModifier[], CultureInfo, String[])

指定したメンバーを呼び出します。 呼び出すメソッドはアクセス可能でなければならず、指定したバインダーと呼び出し属性の制約の下で、指定された引数リストに対する一致の特定性が最高のものでなければなりません。

IsArrayImpl()

派生クラスによってオーバーライドされるときに、IsArray プロパティを実装し、Type が配列かどうかを判断します。

IsArrayImpl()

派生クラスによってオーバーライドされるときに、IsArray プロパティを実装し、Type が配列かどうかを判断します。

(継承元 Type)
IsAssignableFrom(Type)

指定された Type をこのオブジェクトに割り当てることができるかどうかを示す値を取得します。

IsAssignableFrom(Type)

実行時のクラスの新しいインスタンスを定義し、作成します。

(継承元 TypeInfo)
IsAssignableFrom(TypeInfo)

指定された TypeInfo オブジェクトをこのオブジェクトに割り当てることができるかどうかを示す値を取得します。

IsAssignableTo(Type)

現在の型を、指定した targetType の変数に代入できるかどうかを判断します。

(継承元 Type)
IsByRefImpl()

派生クラスによってオーバーライドされるときに、IsByRef プロパティを実装し、Type が参照渡しかどうかを判断します。

IsByRefImpl()

派生クラスによってオーバーライドされるときに、IsByRef プロパティを実装し、Type が参照渡しかどうかを判断します。

(継承元 Type)
IsCOMObjectImpl()

派生クラスによってオーバーライドされるときに、IsCOMObject プロパティを実装し、Type が COM オブジェクトかどうかを判断します。

IsCOMObjectImpl()

派生クラスによってオーバーライドされるときに、IsCOMObject プロパティを実装し、Type が COM オブジェクトかどうかを判断します。

(継承元 Type)
IsContextfulImpl()

IsContextful プロパティを実装し、Type をコンテキスト内で管理できるかどうかを判断します。

(継承元 Type)
IsCreated()

現在の動的な型が作成されたかどうかを示す値を返します。

IsCreatedCore()

派生クラスでオーバーライドされた場合、現在の動的型が作成されたかどうかを示す値を返します。

IsDefined(Type, Boolean)

カスタム属性が現在の型に適用されるかどうかを判断します。

IsDefined(Type, Boolean)

派生クラスでオーバーライドされた場合、このメンバーに、指定された型の属性またはその派生型の属性が 1 つ以上適用されているかどうかを示します。

(継承元 MemberInfo)
IsEnumDefined(Object)

指定された値が現在の列挙型に存在するかどうかを示す値を返します。

(継承元 Type)
IsEnumDefined(Object)

実行時のクラスの新しいインスタンスを定義し、作成します。

(継承元 TypeInfo)
IsEquivalentTo(Type)

2 つの COM 型が同じ ID を持ち、型の同値の対象になるかどうかを判断します。

(継承元 Type)
IsEquivalentTo(Type)

実行時のクラスの新しいインスタンスを定義し、作成します。

(継承元 TypeInfo)
IsInstanceOfType(Object)

指定したオブジェクトが現在の Type のインスタンスかどうかを判断します。

(継承元 Type)
IsInstanceOfType(Object)

実行時のクラスの新しいインスタンスを定義し、作成します。

(継承元 TypeInfo)
IsMarshalByRefImpl()

IsMarshalByRef プロパティを実装し、Type が参照渡しでマーシャリングされるかどうかを判断します。

(継承元 Type)
IsPointerImpl()

派生クラスによってオーバーライドされるときに、IsPointer プロパティを実装し、Type がポインターかどうかを判断します。

IsPointerImpl()

派生クラスによってオーバーライドされるときに、IsPointer プロパティを実装し、Type がポインターかどうかを判断します。

(継承元 Type)
IsPrimitiveImpl()

派生クラスによってオーバーライドされるときに、IsPrimitive プロパティを実装し、Type がプリミティブ型の 1 つかどうかを判断します。

IsPrimitiveImpl()

派生クラスによってオーバーライドされるときに、IsPrimitive プロパティを実装し、Type がプリミティブ型の 1 つかどうかを判断します。

(継承元 Type)
IsSubclassOf(Type)

この型が指定した型から派生したものかどうかを判断します。

IsSubclassOf(Type)

実行時のクラスの新しいインスタンスを定義し、作成します。

(継承元 TypeInfo)
IsValueTypeImpl()

IsValueType プロパティを実装するとともに、Type が値型である (つまり、クラスやインターフェイスでない) かどうかを判断します。

(継承元 Type)
MakeArrayType()

下限を 0 に設定して現在の型の 1 次元配列を表す Type オブジェクトを返します。

MakeArrayType()

下限を 0 に設定して現在の型の 1 次元配列を表す Type オブジェクトを返します。

(継承元 Type)
MakeArrayType(Int32)

次元数を指定して現在の型の配列を表す Type オブジェクトを返します。

MakeArrayType(Int32)

次元数を指定して現在の型の配列を表す Type オブジェクトを返します。

(継承元 Type)
MakeByRefType()

ref パラメーター (Visual Basic の場合は ByRef) として渡されるときに現在の型を表す Type オブジェクトを返します。

MakeByRefType()

ref パラメーター (Visual Basic の場合は ByRef パラメーター) として渡されるときに現在の型を表す Type オブジェクトを返します。

(継承元 Type)
MakeGenericType(Type[])

型の配列の要素を現在のジェネリック型定義の型パラメーターで置き換え、結果の構築型を返します。

MakeGenericType(Type[])

型の配列の要素を現在のジェネリック型定義の型パラメーターで置き換え、結果の構築型を表す Type オブジェクトを返します。

(継承元 Type)
MakePointerType()

現在の型を指すアンマネージ ポインターの型を表す Type オブジェクトを返します。

MakePointerType()

現在の型へのポインターを表す Type オブジェクトを返します。

(継承元 Type)
MemberwiseClone()

現在の Object の簡易コピーを作成します。

(継承元 Object)
SetCustomAttribute(ConstructorInfo, Byte[])

指定されたカスタム属性の blob を使用して、カスタム属性を設定します。

SetCustomAttribute(CustomAttributeBuilder)

カスタム属性ビルダーを使用して、カスタム属性を設定します。

SetCustomAttributeCore(ConstructorInfo, ReadOnlySpan<Byte>)

派生クラスでオーバーライドされた場合は、このアセンブリにカスタム属性を設定します。

SetParent(Type)

現在作成中の型の基本型を設定します。

SetParentCore(Type)

派生クラスでオーバーライドされた場合は、現在構築中の型の基本型を設定します。

ToString()

名前空間を含まない型の名前を返します。

明示的なインターフェイスの実装

_MemberInfo.GetIDsOfNames(Guid, IntPtr, UInt32, UInt32, IntPtr)

一連の名前を対応する一連のディスパッチ識別子に割り当てます。

(継承元 MemberInfo)
_MemberInfo.GetType()

Type クラスを表す MemberInfo オブジェクトを取得します。

(継承元 MemberInfo)
_MemberInfo.GetTypeInfo(UInt32, UInt32, IntPtr)

オブジェクトの型情報を取得します。この型情報を使用して、インターフェイスの型情報を取得できます。

(継承元 MemberInfo)
_MemberInfo.GetTypeInfoCount(UInt32)

オブジェクトが提供する型情報インターフェイスの数 (0 または 1) を取得します。

(継承元 MemberInfo)
_MemberInfo.Invoke(UInt32, Guid, UInt32, Int16, IntPtr, IntPtr, IntPtr, IntPtr)

オブジェクトによって公開されたプロパティおよびメソッドへのアクセスを提供します。

(継承元 MemberInfo)
_Type.GetIDsOfNames(Guid, IntPtr, UInt32, UInt32, IntPtr)

一連の名前を対応する一連のディスパッチ識別子に割り当てます。

(継承元 Type)
_Type.GetTypeInfo(UInt32, UInt32, IntPtr)

オブジェクトの型情報を取得します。この型情報を使用して、インターフェイスの型情報を取得できます。

(継承元 Type)
_Type.GetTypeInfoCount(UInt32)

オブジェクトが提供する型情報インターフェイスの数 (0 または 1) を取得します。

(継承元 Type)
_Type.Invoke(UInt32, Guid, UInt32, Int16, IntPtr, IntPtr, IntPtr, IntPtr)

オブジェクトによって公開されたプロパティおよびメソッドへのアクセスを提供します。

(継承元 Type)
_TypeBuilder.GetIDsOfNames(Guid, IntPtr, UInt32, UInt32, IntPtr)

一連の名前を対応する一連のディスパッチ識別子に割り当てます。

_TypeBuilder.GetTypeInfo(UInt32, UInt32, IntPtr)

オブジェクトの型情報を取得します。この型情報を使用して、インターフェイスの型情報を取得できます。

_TypeBuilder.GetTypeInfoCount(UInt32)

オブジェクトが提供する型情報インターフェイスの数 (0 または 1) を取得します。

_TypeBuilder.Invoke(UInt32, Guid, UInt32, Int16, IntPtr, IntPtr, IntPtr, IntPtr)

オブジェクトによって公開されたプロパティおよびメソッドへのアクセスを提供します。

ICustomAttributeProvider.GetCustomAttributes(Boolean)

名前付きの属性を除く、このメンバーに定義されているすべてのカスタム属性の配列、またはカスタム属性がない場合は空の配列を返します。

(継承元 MemberInfo)
ICustomAttributeProvider.GetCustomAttributes(Type, Boolean)

型で識別された、このメンバーに定義されているカスタム属性の配列、または、この型のカスタム属性がない場合は空の配列を返します。

(継承元 MemberInfo)
ICustomAttributeProvider.IsDefined(Type, Boolean)

attributeType の 1 つ以上のインスタンスがこのメンバーで定義されているかどうかを示します。

(継承元 MemberInfo)
IReflectableType.GetTypeInfo()

現在の型の表現を TypeInfo オブジェクトとして返します。

(継承元 TypeInfo)

拡張メソッド

GetCustomAttribute(MemberInfo, Type)

指定したメンバーに適用される指定した型のカスタム属性を取得します。

GetCustomAttribute(MemberInfo, Type, Boolean)

指定したメンバーに適用される指定した型のカスタム属性を取得し、オプションでそのメンバーの先祖を調べます。

GetCustomAttribute<T>(MemberInfo)

指定したメンバーに適用される指定した型のカスタム属性を取得します。

GetCustomAttribute<T>(MemberInfo, Boolean)

指定したメンバーに適用される指定した型のカスタム属性を取得し、オプションでそのメンバーの先祖を調べます。

GetCustomAttributes(MemberInfo)

指定されたメンバーに適用されるカスタム属性のコレクションを取得します。

GetCustomAttributes(MemberInfo, Boolean)

指定されたメンバーに適用されるカスタム属性のコレクションを取得し、オプションでそのメンバーの先祖を調べます。

GetCustomAttributes(MemberInfo, Type)

指定されたメンバーに適用される指定された型のカスタム属性のコレクションを取得します。

GetCustomAttributes(MemberInfo, Type, Boolean)

指定されたメンバーに適用されている指定された型のカスタム属性のコレクションを取得し、オプションでそのメンバーの先祖を調べます。

GetCustomAttributes<T>(MemberInfo)

指定されたメンバーに適用される指定された型のカスタム属性のコレクションを取得します。

GetCustomAttributes<T>(MemberInfo, Boolean)

指定されたメンバーに適用されている指定された型のカスタム属性のコレクションを取得し、オプションでそのメンバーの先祖を調べます。

IsDefined(MemberInfo, Type)

指定された型のカスタム属性が指定されたメンバーに適用されているかどうかを示します。

IsDefined(MemberInfo, Type, Boolean)

指定された型のカスタム属性が指定されたメンバーに適用され、オプションで先祖に適用されているかどうかを示します。

GetTypeInfo(Type)

指定された型の TypeInfo 形式を返します。

GetMetadataToken(MemberInfo)

指定されたメンバーのメタデータ トークンを取得します (存在する場合)。

HasMetadataToken(MemberInfo)

指定されたメンバーに対してメタデータ トークンを使用できるかどうかを示す値を返します。

GetRuntimeEvent(Type, String)

指定したイベントを表すオブジェクトを取得します。

GetRuntimeEvents(Type)

指定した型で定義されるすべてのイベントを表すコレクションを取得します。

GetRuntimeField(Type, String)

指定したフィールドを表すオブジェクトを取得します。

GetRuntimeFields(Type)

指定した型で定義されるすべてのフィールドを表すコレクションを取得します。

GetRuntimeInterfaceMap(TypeInfo, Type)

指定した型とインターフェイスに対するインターフェイスの割り当てを返します。

GetRuntimeMethod(Type, String, Type[])

指定したメソッドを表すオブジェクトを取得します。

GetRuntimeMethods(Type)

指定した型で定義されるすべてのメソッドを表すコレクションを取得します。

GetRuntimeProperties(Type)

指定した型で定義されるすべてのプロパティを表すコレクションを取得します。

GetRuntimeProperty(Type, String)

指定したプロパティを表すオブジェクトを取得します。

GetConstructor(Type, Type[])

実行時のクラスの新しいインスタンスを定義し、作成します。

GetConstructors(Type)

実行時のクラスの新しいインスタンスを定義し、作成します。

GetConstructors(Type, BindingFlags)

実行時のクラスの新しいインスタンスを定義し、作成します。

GetDefaultMembers(Type)

実行時のクラスの新しいインスタンスを定義し、作成します。

GetEvent(Type, String)

実行時のクラスの新しいインスタンスを定義し、作成します。

GetEvent(Type, String, BindingFlags)

実行時のクラスの新しいインスタンスを定義し、作成します。

GetEvents(Type)

実行時のクラスの新しいインスタンスを定義し、作成します。

GetEvents(Type, BindingFlags)

実行時のクラスの新しいインスタンスを定義し、作成します。

GetField(Type, String)

実行時のクラスの新しいインスタンスを定義し、作成します。

GetField(Type, String, BindingFlags)

実行時のクラスの新しいインスタンスを定義し、作成します。

GetFields(Type)

実行時のクラスの新しいインスタンスを定義し、作成します。

GetFields(Type, BindingFlags)

実行時のクラスの新しいインスタンスを定義し、作成します。

GetGenericArguments(Type)

実行時のクラスの新しいインスタンスを定義し、作成します。

GetInterfaces(Type)

実行時のクラスの新しいインスタンスを定義し、作成します。

GetMember(Type, String)

実行時のクラスの新しいインスタンスを定義し、作成します。

GetMember(Type, String, BindingFlags)

実行時のクラスの新しいインスタンスを定義し、作成します。

GetMembers(Type)

実行時のクラスの新しいインスタンスを定義し、作成します。

GetMembers(Type, BindingFlags)

実行時のクラスの新しいインスタンスを定義し、作成します。

GetMethod(Type, String)

実行時のクラスの新しいインスタンスを定義し、作成します。

GetMethod(Type, String, BindingFlags)

実行時のクラスの新しいインスタンスを定義し、作成します。

GetMethod(Type, String, Type[])

実行時のクラスの新しいインスタンスを定義し、作成します。

GetMethods(Type)

実行時のクラスの新しいインスタンスを定義し、作成します。

GetMethods(Type, BindingFlags)

実行時のクラスの新しいインスタンスを定義し、作成します。

GetNestedType(Type, String, BindingFlags)

実行時のクラスの新しいインスタンスを定義し、作成します。

GetNestedTypes(Type, BindingFlags)

実行時のクラスの新しいインスタンスを定義し、作成します。

GetProperties(Type)

実行時のクラスの新しいインスタンスを定義し、作成します。

GetProperties(Type, BindingFlags)

実行時のクラスの新しいインスタンスを定義し、作成します。

GetProperty(Type, String)

実行時のクラスの新しいインスタンスを定義し、作成します。

GetProperty(Type, String, BindingFlags)

実行時のクラスの新しいインスタンスを定義し、作成します。

GetProperty(Type, String, Type)

実行時のクラスの新しいインスタンスを定義し、作成します。

GetProperty(Type, String, Type, Type[])

実行時のクラスの新しいインスタンスを定義し、作成します。

IsAssignableFrom(Type, Type)

実行時のクラスの新しいインスタンスを定義し、作成します。

IsInstanceOfType(Type, Object)

実行時のクラスの新しいインスタンスを定義し、作成します。

適用対象

こちらもご覧ください