GenericTypeParameterBuilder クラス

定義

動的に定義されているジェネリック型のジェネリック型パラメーターとメソッドを定義して作成します。 このクラスは継承できません。

public ref class GenericTypeParameterBuilder sealed : Type
public ref class GenericTypeParameterBuilder sealed : System::Reflection::TypeInfo
public ref class GenericTypeParameterBuilder abstract : System::Reflection::TypeInfo
public sealed class GenericTypeParameterBuilder : Type
public sealed class GenericTypeParameterBuilder : System.Reflection.TypeInfo
public abstract class GenericTypeParameterBuilder : System.Reflection.TypeInfo
[System.Runtime.InteropServices.ComVisible(true)]
public sealed class GenericTypeParameterBuilder : Type
[System.Runtime.InteropServices.ComVisible(true)]
public sealed class GenericTypeParameterBuilder : System.Reflection.TypeInfo
type GenericTypeParameterBuilder = class
    inherit Type
type GenericTypeParameterBuilder = class
    inherit TypeInfo
[<System.Runtime.InteropServices.ComVisible(true)>]
type GenericTypeParameterBuilder = class
    inherit Type
[<System.Runtime.InteropServices.ComVisible(true)>]
type GenericTypeParameterBuilder = class
    inherit TypeInfo
Public NotInheritable Class GenericTypeParameterBuilder
Inherits Type
Public NotInheritable Class GenericTypeParameterBuilder
Inherits TypeInfo
Public MustInherit Class GenericTypeParameterBuilder
Inherits TypeInfo
継承
GenericTypeParameterBuilder
継承
GenericTypeParameterBuilder
継承
GenericTypeParameterBuilder
属性

次のコード例では、2 つの型パラメーターを持つジェネリック型を作成し、アセンブリ GenericEmitExample1.dll に保存します。 Ildasm.exe (IL 逆アセンブラー) を使用して、生成された型を表示できます。 動的ジェネリック型の定義に関連する手順の詳細については、「 方法: リフレクション出力を使用してジェネリック型を定義する」を参照してください。

using namespace System;
using namespace System::Reflection;
using namespace System::Reflection::Emit;
using namespace System::Collections::Generic;

// Dummy class to satisfy TFirst constraints.
//
public ref class Example {};

// Define a trivial base class and two trivial interfaces 
// to use when demonstrating constraints.
//
public ref class ExampleBase {};
public interface class IExampleA {};
public interface class IExampleB {};

// Define a trivial type that can substitute for type parameter 
// TSecond.
//
public ref class ExampleDerived : ExampleBase, IExampleA, IExampleB {};

// List the constraint flags. The GenericParameterAttributes
// enumeration contains two sets of attributes, variance and
// constraints. For this example, only constraints are used.
//
static void ListConstraintAttributes( Type^ t )
{
   // Mask off the constraint flags. 
   GenericParameterAttributes constraints = 
       t->GenericParameterAttributes & 
       GenericParameterAttributes::SpecialConstraintMask;

   if ((constraints & GenericParameterAttributes::ReferenceTypeConstraint)
           != GenericParameterAttributes::None)
       Console::WriteLine( L"    ReferenceTypeConstraint");

   if ((constraints & GenericParameterAttributes::NotNullableValueTypeConstraint)
           != GenericParameterAttributes::None)
       Console::WriteLine( L"    NotNullableValueTypeConstraint");

   if ((constraints & GenericParameterAttributes::DefaultConstructorConstraint)
           != GenericParameterAttributes::None)
       Console::WriteLine( L"    DefaultConstructorConstraint");
}

static void DisplayGenericParameters( Type^ t )
{
   if (!t->IsGenericType)
   {
       Console::WriteLine( L"Type '{0}' is not generic." );
       return;
   }
   if (!t->IsGenericTypeDefinition)
       t = t->GetGenericTypeDefinition();

   array<Type^>^ typeParameters = t->GetGenericArguments();
   Console::WriteLine( L"\r\nListing {0} type parameters for type '{1}'.", 
       typeParameters->Length, t );

   for each ( Type^ tParam in typeParameters )
   {
       Console::WriteLine( L"\r\nType parameter {0}:", 
           tParam->ToString() );

       for each (Type^ c in tParam->GetGenericParameterConstraints())
       {
           if (c->IsInterface)
               Console::WriteLine( L"    Interface constraint: {0}", c);
           else
               Console::WriteLine( L"    Base type constraint: {0}", c);
       }
       ListConstraintAttributes(tParam);
   }
}

void main()
{
   // Define a dynamic assembly to contain the sample type. The
   // assembly will be run and also saved to disk, so
   // AssemblyBuilderAccess.RunAndSave is specified.
   //
   AppDomain^ myDomain = AppDomain::CurrentDomain;
   AssemblyName^ myAsmName = gcnew AssemblyName( L"GenericEmitExample1" );
   AssemblyBuilder^ myAssembly = myDomain->DefineDynamicAssembly( 
       myAsmName, AssemblyBuilderAccess::RunAndSave );

   // An assembly is made up of executable modules. For a single-
   // module assembly, the module name and file name are the same 
   // as the assembly name. 
   //
   ModuleBuilder^ myModule = myAssembly->DefineDynamicModule( 
       myAsmName->Name, String::Concat( myAsmName->Name, L".dll" ) );

   // Get type objects for the base class trivial interfaces to
   // be used as constraints.
   //
   Type^ baseType = ExampleBase::typeid; 
   Type^ interfaceA = IExampleA::typeid; 
   Type^ interfaceB = IExampleB::typeid;
   
   // Define the sample type.
   //
   TypeBuilder^ myType = myModule->DefineType( L"Sample", 
       TypeAttributes::Public );
   
   Console::WriteLine( L"Type 'Sample' is generic: {0}", 
       myType->IsGenericType );
   
   // Define type parameters for the type. Until you do this, 
   // the type is not generic, as the preceding and following 
   // WriteLine statements show. The type parameter names are
   // specified as an array of strings. To make the code
   // easier to read, each GenericTypeParameterBuilder is placed
   // in a variable with the same name as the type parameter.
   // 
   array<String^>^typeParamNames = {L"TFirst",L"TSecond"};
   array<GenericTypeParameterBuilder^>^typeParams = 
       myType->DefineGenericParameters( typeParamNames );

   GenericTypeParameterBuilder^ TFirst = typeParams[0];
   GenericTypeParameterBuilder^ TSecond = typeParams[1];

   Console::WriteLine( L"Type 'Sample' is generic: {0}", 
       myType->IsGenericType );
   
   // Apply constraints to the type parameters.
   //
   // A type that is substituted for the first parameter, TFirst,
   // must be a reference type and must have a parameterless
   // constructor.
   TFirst->SetGenericParameterAttributes( 
       GenericParameterAttributes::DefaultConstructorConstraint | 
       GenericParameterAttributes::ReferenceTypeConstraint 
   );

   // A type that is substituted for the second type
   // parameter must implement IExampleA and IExampleB, and
   // inherit from the trivial test class ExampleBase. The
   // interface constraints are specified as an array
   // containing the interface types. 
   array<Type^>^interfaceTypes = { interfaceA, interfaceB };
   TSecond->SetInterfaceConstraints( interfaceTypes );
   TSecond->SetBaseTypeConstraint( baseType );

   // The following code adds a private field named ExampleField,
   // of type TFirst.
   FieldBuilder^ exField = 
       myType->DefineField("ExampleField", TFirst, 
           FieldAttributes::Private);

   // Define a static method that takes an array of TFirst and 
   // returns a List<TFirst> containing all the elements of 
   // the array. To define this method it is necessary to create
   // the type List<TFirst> by calling MakeGenericType on the
   // generic type definition, generic<T> List. 
   // The parameter type is created by using the
   // MakeArrayType method. 
   //
   Type^ listOf = List::typeid;
   Type^ listOfTFirst = listOf->MakeGenericType(TFirst);
   array<Type^>^ mParamTypes = { TFirst->MakeArrayType() };

   MethodBuilder^ exMethod = 
       myType->DefineMethod("ExampleMethod", 
           MethodAttributes::Public | MethodAttributes::Static, 
           listOfTFirst, 
           mParamTypes);

   // Emit the method body. 
   // The method body consists of just three opcodes, to load 
   // the input array onto the execution stack, to call the 
   // List<TFirst> constructor that takes IEnumerable<TFirst>,
   // which does all the work of putting the input elements into
   // the list, and to return, leaving the list on the stack. The
   // hard work is getting the constructor.
   // 
   // The GetConstructor method is not supported on a 
   // GenericTypeParameterBuilder, so it is not possible to get 
   // the constructor of List<TFirst> directly. There are two
   // steps, first getting the constructor of generic<T> List and then
   // calling a method that converts it to the corresponding 
   // constructor of List<TFirst>.
   //
   // The constructor needed here is the one that takes an
   // IEnumerable<T>. Note, however, that this is not the 
   // generic type definition of generic<T> IEnumerable; instead, the
   // T from generic<T> List must be substituted for the T of 
   // generic<T> IEnumerable. (This seems confusing only because both
   // types have type parameters named T. That is why this example
   // uses the somewhat silly names TFirst and TSecond.) To get
   // the type of the constructor argument, take the generic
   // type definition generic<T> IEnumerable and 
   // call MakeGenericType with the first generic type parameter
   // of generic<T> List. The constructor argument list must be passed
   // as an array, with just one argument in this case.
   // 
   // Now it is possible to get the constructor of generic<T> List,
   // using GetConstructor on the generic type definition. To get
   // the constructor of List<TFirst>, pass List<TFirst> and
   // the constructor from generic<T> List to the static
   // TypeBuilder.GetConstructor method.
   //
   ILGenerator^ ilgen = exMethod->GetILGenerator();
        
   Type^ ienumOf = IEnumerable::typeid;
   Type^ TfromListOf = listOf->GetGenericArguments()[0];
   Type^ ienumOfT = ienumOf->MakeGenericType(TfromListOf);
   array<Type^>^ ctorArgs = {ienumOfT};

   ConstructorInfo^ ctorPrep = listOf->GetConstructor(ctorArgs);
   ConstructorInfo^ ctor = 
       TypeBuilder::GetConstructor(listOfTFirst, ctorPrep);

   ilgen->Emit(OpCodes::Ldarg_0);
   ilgen->Emit(OpCodes::Newobj, ctor);
   ilgen->Emit(OpCodes::Ret);

   // Create the type and save the assembly. 
   Type^ finished = myType->CreateType();
   myAssembly->Save( String::Concat( myAsmName->Name, L".dll" ) );

   // Invoke the method.
   // ExampleMethod is not generic, but the type it belongs to is
   // generic, so in order to get a MethodInfo that can be invoked
   // it is necessary to create a constructed type. The Example 
   // class satisfies the constraints on TFirst, because it is a 
   // reference type and has a default constructor. In order to
   // have a class that satisfies the constraints on TSecond, 
   // this code example defines the ExampleDerived type. These
   // two types are passed to MakeGenericMethod to create the
   // constructed type.
   //
   array<Type^>^ typeArgs = 
       { Example::typeid, ExampleDerived::typeid };
   Type^ constructed = finished->MakeGenericType(typeArgs);
   MethodInfo^ mi = constructed->GetMethod("ExampleMethod");

   // Create an array of Example objects, as input to the generic
   // method. This array must be passed as the only element of an 
   // array of arguments. The first argument of Invoke is 
   // null, because ExampleMethod is static. Display the count
   // on the resulting List<Example>.
   // 
   array<Example^>^ input = { gcnew Example(), gcnew Example() };
   array<Object^>^ arguments = { input };

   List<Example^>^ listX = 
       (List<Example^>^) mi->Invoke(nullptr, arguments);

   Console::WriteLine(
       "\nThere are {0} elements in the List<Example>.", 
       listX->Count);

   DisplayGenericParameters(finished);
}

/* This code example produces the following output:

Type 'Sample' is generic: False
Type 'Sample' is generic: True

There are 2 elements in the List<Example>.

Listing 2 type parameters for type 'Sample[TFirst,TSecond]'.

Type parameter TFirst:
    ReferenceTypeConstraint
    DefaultConstructorConstraint

Type parameter TSecond:
    Interface constraint: IExampleA
    Interface constraint: IExampleB
    Base type constraint: ExampleBase
 */
using System;
using System.Reflection;
using System.Reflection.Emit;
using System.Collections.Generic;

// Define a trivial base class and two trivial interfaces
// to use when demonstrating constraints.
//
public class ExampleBase {}

public interface IExampleA {}

public interface IExampleB {}

// Define a trivial type that can substitute for type parameter
// TSecond.
//
public class ExampleDerived : ExampleBase, IExampleA, IExampleB {}

public class Example
{
    public static void Main()
    {
        // Define a dynamic assembly to contain the sample type. The
        // assembly will not be run, but only saved to disk, so
        // AssemblyBuilderAccess.Save is specified.
        //
        AppDomain myDomain = AppDomain.CurrentDomain;
        AssemblyName myAsmName = new AssemblyName("GenericEmitExample1");
        AssemblyBuilder myAssembly =
            myDomain.DefineDynamicAssembly(myAsmName,
                AssemblyBuilderAccess.RunAndSave);

        // An assembly is made up of executable modules. For a single-
        // module assembly, the module name and file name are the same
        // as the assembly name.
        //
        ModuleBuilder myModule =
            myAssembly.DefineDynamicModule(myAsmName.Name,
               myAsmName.Name + ".dll");

        // Get type objects for the base class trivial interfaces to
        // be used as constraints.
        //
        Type baseType = typeof(ExampleBase);
        Type interfaceA = typeof(IExampleA);
        Type interfaceB = typeof(IExampleB);

        // Define the sample type.
        //
        TypeBuilder myType =
            myModule.DefineType("Sample", TypeAttributes.Public);

        Console.WriteLine("Type 'Sample' is generic: {0}",
            myType.IsGenericType);

        // Define type parameters for the type. Until you do this,
        // the type is not generic, as the preceding and following
        // WriteLine statements show. The type parameter names are
        // specified as an array of strings. To make the code
        // easier to read, each GenericTypeParameterBuilder is placed
        // in a variable with the same name as the type parameter.
        //
        string[] typeParamNames = {"TFirst", "TSecond"};
        GenericTypeParameterBuilder[] typeParams =
            myType.DefineGenericParameters(typeParamNames);

        GenericTypeParameterBuilder TFirst = typeParams[0];
        GenericTypeParameterBuilder TSecond = typeParams[1];

        Console.WriteLine("Type 'Sample' is generic: {0}",
            myType.IsGenericType);

        // Apply constraints to the type parameters.
        //
        // A type that is substituted for the first parameter, TFirst,
        // must be a reference type and must have a parameterless
        // constructor.
        TFirst.SetGenericParameterAttributes(
            GenericParameterAttributes.DefaultConstructorConstraint |
            GenericParameterAttributes.ReferenceTypeConstraint);

        // A type that is substituted for the second type
        // parameter must implement IExampleA and IExampleB, and
        // inherit from the trivial test class ExampleBase. The
        // interface constraints are specified as an array
        // containing the interface types.
        TSecond.SetBaseTypeConstraint(baseType);
        Type[] interfaceTypes = {interfaceA, interfaceB};
        TSecond.SetInterfaceConstraints(interfaceTypes);

        // The following code adds a private field named ExampleField,
        // of type TFirst.
        FieldBuilder exField =
            myType.DefineField("ExampleField", TFirst,
                FieldAttributes.Private);

        // Define a static method that takes an array of TFirst and
        // returns a List<TFirst> containing all the elements of
        // the array. To define this method it is necessary to create
        // the type List<TFirst> by calling MakeGenericType on the
        // generic type definition, List<T>. (The T is omitted with
        // the typeof operator when you get the generic type
        // definition.) The parameter type is created by using the
        // MakeArrayType method.
        //
        Type listOf = typeof(List<>);
        Type listOfTFirst = listOf.MakeGenericType(TFirst);
        Type[] mParamTypes = {TFirst.MakeArrayType()};

        MethodBuilder exMethod =
            myType.DefineMethod("ExampleMethod",
                MethodAttributes.Public | MethodAttributes.Static,
                listOfTFirst,
                mParamTypes);

        // Emit the method body.
        // The method body consists of just three opcodes, to load
        // the input array onto the execution stack, to call the
        // List<TFirst> constructor that takes IEnumerable<TFirst>,
        // which does all the work of putting the input elements into
        // the list, and to return, leaving the list on the stack. The
        // hard work is getting the constructor.
        //
        // The GetConstructor method is not supported on a
        // GenericTypeParameterBuilder, so it is not possible to get
        // the constructor of List<TFirst> directly. There are two
        // steps, first getting the constructor of List<T> and then
        // calling a method that converts it to the corresponding
        // constructor of List<TFirst>.
        //
        // The constructor needed here is the one that takes an
        // IEnumerable<T>. Note, however, that this is not the
        // generic type definition of IEnumerable<T>; instead, the
        // T from List<T> must be substituted for the T of
        // IEnumerable<T>. (This seems confusing only because both
        // types have type parameters named T. That is why this example
        // uses the somewhat silly names TFirst and TSecond.) To get
        // the type of the constructor argument, take the generic
        // type definition IEnumerable<T> (expressed as
        // IEnumerable<> when you use the typeof operator) and
        // call MakeGenericType with the first generic type parameter
        // of List<T>. The constructor argument list must be passed
        // as an array, with just one argument in this case.
        //
        // Now it is possible to get the constructor of List<T>,
        // using GetConstructor on the generic type definition. To get
        // the constructor of List<TFirst>, pass List<TFirst> and
        // the constructor from List<T> to the static
        // TypeBuilder.GetConstructor method.
        //
        ILGenerator ilgen = exMethod.GetILGenerator();

        Type ienumOf = typeof(IEnumerable<>);
        Type TfromListOf = listOf.GetGenericArguments()[0];
        Type ienumOfT = ienumOf.MakeGenericType(TfromListOf);
        Type[] ctorArgs = {ienumOfT};

        ConstructorInfo ctorPrep = listOf.GetConstructor(ctorArgs);
        ConstructorInfo ctor =
            TypeBuilder.GetConstructor(listOfTFirst, ctorPrep);

        ilgen.Emit(OpCodes.Ldarg_0);
        ilgen.Emit(OpCodes.Newobj, ctor);
        ilgen.Emit(OpCodes.Ret);

        // Create the type and save the assembly.
        Type finished = myType.CreateType();
        myAssembly.Save(myAsmName.Name+".dll");

        // Invoke the method.
        // ExampleMethod is not generic, but the type it belongs to is
        // generic, so in order to get a MethodInfo that can be invoked
        // it is necessary to create a constructed type. The Example
        // class satisfies the constraints on TFirst, because it is a
        // reference type and has a default constructor. In order to
        // have a class that satisfies the constraints on TSecond,
        // this code example defines the ExampleDerived type. These
        // two types are passed to MakeGenericMethod to create the
        // constructed type.
        //
        Type[] typeArgs = {typeof(Example), typeof(ExampleDerived)};
        Type constructed = finished.MakeGenericType(typeArgs);
        MethodInfo mi = constructed.GetMethod("ExampleMethod");

        // Create an array of Example objects, as input to the generic
        // method. This array must be passed as the only element of an
        // array of arguments. The first argument of Invoke is
        // null, because ExampleMethod is static. Display the count
        // on the resulting List<Example>.
        //
        Example[] input = {new Example(), new Example()};
        object[] arguments = {input};

        List<Example> listX =
            (List<Example>) mi.Invoke(null, arguments);

        Console.WriteLine(
            "\nThere are {0} elements in the List<Example>.",
            listX.Count);

        DisplayGenericParameters(finished);
    }

    private static void DisplayGenericParameters(Type t)
    {
        if (!t.IsGenericType)
        {
            Console.WriteLine("Type '{0}' is not generic.");
            return;
        }
        if (!t.IsGenericTypeDefinition)
        {
            t = t.GetGenericTypeDefinition();
        }

        Type[] typeParameters = t.GetGenericArguments();
        Console.WriteLine("\nListing {0} type parameters for type '{1}'.",
            typeParameters.Length, t);

        foreach( Type tParam in typeParameters )
        {
            Console.WriteLine("\r\nType parameter {0}:", tParam.ToString());

            foreach( Type c in tParam.GetGenericParameterConstraints() )
            {
                if (c.IsInterface)
                {
                    Console.WriteLine("    Interface constraint: {0}", c);
                }
                else
                {
                    Console.WriteLine("    Base type constraint: {0}", c);
                }
            }

            ListConstraintAttributes(tParam);
        }
    }

    // List the constraint flags. The GenericParameterAttributes
    // enumeration contains two sets of attributes, variance and
    // constraints. For this example, only constraints are used.
    //
    private static void ListConstraintAttributes(Type t)
    {
        // Mask off the constraint flags.
        GenericParameterAttributes constraints =
            t.GenericParameterAttributes & GenericParameterAttributes.SpecialConstraintMask;

        if ((constraints & GenericParameterAttributes.ReferenceTypeConstraint)
            != GenericParameterAttributes.None)
        {
            Console.WriteLine("    ReferenceTypeConstraint");
        }

        if ((constraints & GenericParameterAttributes.NotNullableValueTypeConstraint)
            != GenericParameterAttributes.None)
        {
            Console.WriteLine("    NotNullableValueTypeConstraint");
        }

        if ((constraints & GenericParameterAttributes.DefaultConstructorConstraint)
            !=GenericParameterAttributes.None)
        {
            Console.WriteLine("    DefaultConstructorConstraint");
        }
    }
}

/* This code example produces the following output:

Type 'Sample' is generic: False
Type 'Sample' is generic: True

There are 2 elements in the List<Example>.

Listing 2 type parameters for type 'Sample[TFirst,TSecond]'.

Type parameter TFirst:
    ReferenceTypeConstraint
    DefaultConstructorConstraint

Type parameter TSecond:
    Interface constraint: IExampleA
    Interface constraint: IExampleB
    Base type constraint: ExampleBase
 */
Imports System.Reflection
Imports System.Reflection.Emit
Imports System.Collections.Generic

' Define a trivial base class and two trivial interfaces 
' to use when demonstrating constraints.
'
Public Class ExampleBase
End Class

Public Interface IExampleA
End Interface

Public Interface IExampleB
End Interface

' Define a trivial type that can substitute for type parameter 
' TSecond.
'
Public Class ExampleDerived
    Inherits ExampleBase
    Implements IExampleA, IExampleB
End Class

Public Class Example
    Public Shared Sub Main()
        ' Define a dynamic assembly to contain the sample type. The
        ' assembly will not be run, but only saved to disk, so
        ' AssemblyBuilderAccess.Save is specified.
        '
        Dim myDomain As AppDomain = AppDomain.CurrentDomain
        Dim myAsmName As New AssemblyName("GenericEmitExample1")
        Dim myAssembly As AssemblyBuilder = myDomain.DefineDynamicAssembly( _
            myAsmName, _
            AssemblyBuilderAccess.RunAndSave)

        ' An assembly is made up of executable modules. For a single-
        ' module assembly, the module name and file name are the same 
        ' as the assembly name. 
        '
        Dim myModule As ModuleBuilder = myAssembly.DefineDynamicModule( _
            myAsmName.Name, _
            myAsmName.Name & ".dll")

        ' Get type objects for the base class trivial interfaces to
        ' be used as constraints.
        '
        Dim baseType As Type = GetType(ExampleBase)
        Dim interfaceA As Type = GetType(IExampleA)
        Dim interfaceB As Type = GetType(IExampleB)
                
        ' Define the sample type.
        '
        Dim myType As TypeBuilder = myModule.DefineType( _
            "Sample", _
            TypeAttributes.Public)

        Console.WriteLine("Type 'Sample' is generic: {0}", _
            myType.IsGenericType)

        ' Define type parameters for the type. Until you do this, 
        ' the type is not generic, as the preceding and following 
        ' WriteLine statements show. The type parameter names are
        ' specified as an array of strings. To make the code
        ' easier to read, each GenericTypeParameterBuilder is placed
        ' in a variable with the same name as the type parameter.
        ' 
        Dim typeParamNames() As String = {"TFirst", "TSecond"}
        Dim typeParams() As GenericTypeParameterBuilder = _
            myType.DefineGenericParameters(typeParamNames)

        Dim TFirst As GenericTypeParameterBuilder = typeParams(0)
        Dim TSecond As GenericTypeParameterBuilder = typeParams(1)

        Console.WriteLine("Type 'Sample' is generic: {0}", _
            myType.IsGenericType)

        ' Apply constraints to the type parameters.
        '
        ' A type that is substituted for the first parameter, TFirst,
        ' must be a reference type and must have a parameterless
        ' constructor.
        TFirst.SetGenericParameterAttributes( _
            GenericParameterAttributes.DefaultConstructorConstraint _
            Or GenericParameterAttributes.ReferenceTypeConstraint)

        ' A type that is substituted for the second type
        ' parameter must implement IExampleA and IExampleB, and
        ' inherit from the trivial test class ExampleBase. The
        ' interface constraints are specified as an array 
        ' containing the interface types.
        TSecond.SetBaseTypeConstraint(baseType)
        Dim interfaceTypes() As Type = {interfaceA, interfaceB}
        TSecond.SetInterfaceConstraints(interfaceTypes)

        ' The following code adds a private field named ExampleField,
        ' of type TFirst.
        Dim exField As FieldBuilder = _
            myType.DefineField("ExampleField", TFirst, _
                FieldAttributes.Private)

        ' Define a Shared method that takes an array of TFirst and 
        ' returns a List(Of TFirst) containing all the elements of 
        ' the array. To define this method it is necessary to create
        ' the type List(Of TFirst) by calling MakeGenericType on the
        ' generic type definition, List(Of T). (The T is omitted with
        ' the GetType operator when you get the generic type 
        ' definition.) The parameter type is created by using the
        ' MakeArrayType method. 
        '
        Dim listOf As Type = GetType(List(Of ))
        Dim listOfTFirst As Type = listOf.MakeGenericType(TFirst)
        Dim mParamTypes() As Type = { TFirst.MakeArrayType() }

        Dim exMethod As MethodBuilder = _
            myType.DefineMethod("ExampleMethod", _
                MethodAttributes.Public Or MethodAttributes.Static, _
                listOfTFirst, _
                mParamTypes)

        ' Emit the method body. 
        ' The method body consists of just three opcodes, to load 
        ' the input array onto the execution stack, to call the 
        ' List(Of TFirst) constructor that takes IEnumerable(Of TFirst),
        ' which does all the work of putting the input elements into
        ' the list, and to return, leaving the list on the stack. The
        ' hard work is getting the constructor.
        ' 
        ' The GetConstructor method is not supported on a 
        ' GenericTypeParameterBuilder, so it is not possible to get 
        ' the constructor of List(Of TFirst) directly. There are two
        ' steps, first getting the constructor of List(Of T) and then
        ' calling a method that converts it to the corresponding 
        ' constructor of List(Of TFirst).
        '
        ' The constructor needed here is the one that takes an
        ' IEnumerable(Of T). Note, however, that this is not the 
        ' generic type definition of IEnumerable(Of T); instead, the
        ' T from List(Of T) must be substituted for the T of 
        ' IEnumerable(Of T). (This seems confusing only because both
        ' types have type parameters named T. That is why this example
        ' uses the somewhat silly names TFirst and TSecond.) To get
        ' the type of the constructor argument, take the generic
        ' type definition IEnumerable(Of T) (expressed as 
        ' IEnumerable(Of ) when you use the GetType operator) and 
        ' call MakeGenericType with the first generic type parameter
        ' of List(Of T). The constructor argument list must be passed
        ' as an array, with just one argument in this case.
        ' 
        ' Now it is possible to get the constructor of List(Of T),
        ' using GetConstructor on the generic type definition. To get
        ' the constructor of List(Of TFirst), pass List(Of TFirst) and
        ' the constructor from List(Of T) to the static
        ' TypeBuilder.GetConstructor method.
        '
        Dim ilgen As ILGenerator = exMethod.GetILGenerator()
        
        Dim ienumOf As Type = GetType(IEnumerable(Of ))
        Dim listOfTParams() As Type = listOf.GetGenericArguments()
        Dim TfromListOf As Type = listOfTParams(0)
        Dim ienumOfT As Type = ienumOf.MakeGenericType(TfromListOf)
        Dim ctorArgs() As Type = { ienumOfT }

        Dim ctorPrep As ConstructorInfo = _
            listOf.GetConstructor(ctorArgs)
        Dim ctor As ConstructorInfo = _
            TypeBuilder.GetConstructor(listOfTFirst, ctorPrep)

        ilgen.Emit(OpCodes.Ldarg_0)
        ilgen.Emit(OpCodes.Newobj, ctor)
        ilgen.Emit(OpCodes.Ret)

        ' Create the type and save the assembly. 
        Dim finished As Type = myType.CreateType()
        myAssembly.Save(myAsmName.Name & ".dll")

        ' Invoke the method.
        ' ExampleMethod is not generic, but the type it belongs to is
        ' generic, so in order to get a MethodInfo that can be invoked
        ' it is necessary to create a constructed type. The Example 
        ' class satisfies the constraints on TFirst, because it is a 
        ' reference type and has a default constructor. In order to
        ' have a class that satisfies the constraints on TSecond, 
        ' this code example defines the ExampleDerived type. These
        ' two types are passed to MakeGenericMethod to create the
        ' constructed type.
        '
        Dim typeArgs() As Type = _
            { GetType(Example), GetType(ExampleDerived) }
        Dim constructed As Type = finished.MakeGenericType(typeArgs)
        Dim mi As MethodInfo = constructed.GetMethod("ExampleMethod")

        ' Create an array of Example objects, as input to the generic
        ' method. This array must be passed as the only element of an 
        ' array of arguments. The first argument of Invoke is 
        ' Nothing, because ExampleMethod is Shared. Display the count
        ' on the resulting List(Of Example).
        ' 
        Dim input() As Example = { New Example(), New Example() }
        Dim arguments() As Object = { input }

        Dim listX As List(Of Example) = mi.Invoke(Nothing, arguments)

        Console.WriteLine(vbLf & _
            "There are {0} elements in the List(Of Example).", _
            listX.Count _ 
        )

        DisplayGenericParameters(finished)
    End Sub

    Private Shared Sub DisplayGenericParameters(ByVal t As Type)

        If Not t.IsGenericType Then
            Console.WriteLine("Type '{0}' is not generic.")
            Return
        End If
        If Not t.IsGenericTypeDefinition Then _
            t = t.GetGenericTypeDefinition()

        Dim typeParameters() As Type = t.GetGenericArguments()
        Console.WriteLine(vbCrLf & _
            "Listing {0} type parameters for type '{1}'.", _
            typeParameters.Length, t)

        For Each tParam As Type In typeParameters

            Console.WriteLine(vbCrLf & "Type parameter {0}:", _
                tParam.ToString())

            For Each c As Type In tParam.GetGenericParameterConstraints()
                If c.IsInterface Then
                    Console.WriteLine("    Interface constraint: {0}", c)
                Else
                    Console.WriteLine("    Base type constraint: {0}", c)
                End If
            Next 

            ListConstraintAttributes(tParam)
        Next tParam
    End Sub

    ' List the constraint flags. The GenericParameterAttributes
    ' enumeration contains two sets of attributes, variance and
    ' constraints. For this example, only constraints are used.
    '
    Private Shared Sub ListConstraintAttributes(ByVal t As Type)

        ' Mask off the constraint flags. 
        Dim constraints As GenericParameterAttributes = _
            t.GenericParameterAttributes And _
            GenericParameterAttributes.SpecialConstraintMask

        If (constraints And GenericParameterAttributes.ReferenceTypeConstraint) _
                <> GenericParameterAttributes.None Then _
            Console.WriteLine("    ReferenceTypeConstraint")

        If (constraints And GenericParameterAttributes.NotNullableValueTypeConstraint) _
                <> GenericParameterAttributes.None Then _
            Console.WriteLine("    NotNullableValueTypeConstraint")

        If (constraints And GenericParameterAttributes.DefaultConstructorConstraint) _
                <> GenericParameterAttributes.None Then _
            Console.WriteLine("    DefaultConstructorConstraint")

    End Sub 

End Class

' This code example produces the following output:
'
'Type 'Sample' is generic: False
'Type 'Sample' is generic: True
'
'There are 2 elements in the List(Of Example).
'
'Listing 2 type parameters for type 'Sample[TFirst,TSecond]'.
'
'Type parameter TFirst:
'    ReferenceTypeConstraint
'    DefaultConstructorConstraint
'
'Type parameter TSecond:
'    Interface constraint: IExampleA
'    Interface constraint: IExampleB
'    Base type constraint: ExampleBase

注釈

オブジェクトの GenericTypeParameterBuilder 配列を取得するには、 メソッドを TypeBuilder.DefineGenericParameters 使用して動的型に型パラメーターを追加し、ジェネリック型にするか、 メソッドを MethodBuilder.DefineGenericParameters 使用して動的メソッドに型パラメーターを追加します。 オブジェクトを GenericTypeParameterBuilder 使用して、型パラメーターに制約を追加します。 制約は次の 3 種類です。

  • 基本型制約は、ジェネリック型パラメーターに割り当てられたすべての型が特定の基本型から派生する必要があることを指定します。 メソッドを使用して、この制約を設定します SetBaseTypeConstraint

  • インターフェイス制約は、ジェネリック型パラメーターに割り当てられた任意の型が特定のインターフェイスを実装する必要があることを指定します。 メソッドを使用してインターフェイス制約を SetInterfaceConstraints 設定します。

  • 特殊制約は、ジェネリック型パラメーターに割り当てられた型にパラメーターなしのコンストラクターが必要であること、参照型であるか、値型である必要があることを指定します。 メソッドを使用して、型パラメーターの特別な制約を SetGenericParameterAttributes 設定します。

インターフェイス制約と特別な制約は、 クラスの GenericTypeParameterBuilder メソッドを使用して取得できません。 型パラメーターを含むジェネリック型を作成したら、その Type オブジェクトを使用して制約を反映できます。 メソッドを Type.GetGenericArguments 使用して型パラメーターを取得し、各型パラメーターで メソッドを Type.GetGenericParameterConstraints 使用して基本型制約とインターフェイス制約を取得し、 プロパティを Type.GenericParameterAttributes 使用して特別な制約を取得します。

コンストラクター

GenericTypeParameterBuilder()

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

プロパティ

Assembly

現在の型パラメーターが属するジェネリック型定義を含む動的アセンブリを表す Assembly オブジェクトを取得します。

AssemblyQualifiedName

常に null を取得します。

Attributes

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

Attributes

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

(継承元 Type)
Attributes

動的に定義されているジェネリック型のジェネリック型パラメーターとメソッドを定義して作成します。 このクラスは継承できません。

(継承元 TypeInfo)
BaseType

現在のジェネリック型パラメーターの基本型の制約を取得します。

ContainsGenericParameters

常に true を取得します。

CustomAttributes

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

(継承元 MemberInfo)
DeclaredConstructors

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

(継承元 TypeInfo)
DeclaredEvents

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

(継承元 TypeInfo)
DeclaredFields

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

(継承元 TypeInfo)
DeclaredMembers

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

(継承元 TypeInfo)
DeclaredMethods

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

(継承元 TypeInfo)
DeclaredNestedTypes

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

(継承元 TypeInfo)
DeclaredProperties

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

(継承元 TypeInfo)
DeclaringMethod

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

DeclaringType

ジェネリック型パラメーターが所属する、ジェネリック型定義またはジェネリック メソッド定義を取得します。

FullName

常に null を取得します。

GenericParameterAttributes

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

GenericParameterAttributes

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

(継承元 Type)
GenericParameterPosition

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

GenericTypeArguments

動的に定義されているジェネリック型のジェネリック型パラメーターとメソッドを定義して作成します。 このクラスは継承できません。

GenericTypeArguments

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

(継承元 Type)
GenericTypeArguments

動的に定義されているジェネリック型のジェネリック型パラメーターとメソッドを定義して作成します。 このクラスは継承できません。

(継承元 TypeInfo)
GenericTypeParameters

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

(継承元 TypeInfo)
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

常に true を取得します。

IsGenericType

常に false を返します。

IsGenericTypeDefinition

常に false を取得します。

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

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

(継承元 Type)
IsSecuritySafeCritical

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

(継承元 Type)
IsSecurityTransparent

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

(継承元 Type)
IsSerializable

動的に定義されているジェネリック型のジェネリック型パラメーターとメソッドを定義して作成します。 このクラスは継承できません。

IsSerializable
古い.

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

(継承元 Type)
IsSerializable

動的に定義されているジェネリック型のジェネリック型パラメーターとメソッドを定義して作成します。 このクラスは継承できません。

(継承元 TypeInfo)
IsSignatureType

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

(継承元 Type)
IsSpecialName

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

(継承元 Type)
IsSpecialName

動的に定義されているジェネリック型のジェネリック型パラメーターとメソッドを定義して作成します。 このクラスは継承できません。

(継承元 TypeInfo)
IsSZArray

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

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

常に null を取得します。

ReflectedType

GenericTypeParameterBuilder を取得するために使用した Type オブジェクトを取得します。

ReflectedType

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

(継承元 MemberInfo)
StructLayoutAttribute

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

(継承元 Type)
StructLayoutAttribute

動的に定義されているジェネリック型のジェネリック型パラメーターとメソッドを定義して作成します。 このクラスは継承できません。

(継承元 TypeInfo)
TypeHandle

不完全なジェネリック型パラメーターではサポートされていません。

TypeInitializer

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

(継承元 Type)
TypeInitializer

動的に定義されているジェネリック型のジェネリック型パラメーターとメソッドを定義して作成します。 このクラスは継承できません。

(継承元 TypeInfo)
UnderlyingSystemType

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

UnderlyingSystemType

動的に定義されているジェネリック型のジェネリック型パラメーターとメソッドを定義して作成します。 このクラスは継承できません。

(継承元 TypeInfo)

メソッド

AsType()

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

(継承元 TypeInfo)
Equals(Object)

指定されたオブジェクトが EventToken のインスタンスであり、現在のインスタンスと等しいかどうかテストします。

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[])

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

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

動的に定義されているジェネリック型のジェネリック型パラメーターとメソッドを定義して作成します。 このクラスは継承できません。

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

不完全なジェネリック型パラメーターではサポートされていません。

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

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

(継承元 Type)
GetConstructors()

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

(継承元 Type)
GetConstructors()

動的に定義されているジェネリック型のジェネリック型パラメーターとメソッドを定義して作成します。 このクラスは継承できません。

(継承元 TypeInfo)
GetConstructors(BindingFlags)

不完全なジェネリック型パラメーターではサポートされていません。

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)
GetFields()

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

(継承元 Type)
GetFields()

動的に定義されているジェネリック型のジェネリック型パラメーターとメソッドを定義して作成します。 このクラスは継承できません。

(継承元 TypeInfo)
GetFields(BindingFlags)

不完全なジェネリック型パラメーターではサポートされていません。

GetFields(BindingFlags)

動的に定義されているジェネリック型のジェネリック型パラメーターとメソッドを定義して作成します。 このクラスは継承できません。

(継承元 TypeInfo)
GetFunctionPointerCallingConventions()

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

(継承元 Type)
GetFunctionPointerParameterTypes()

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

(継承元 Type)
GetFunctionPointerReturnType()

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

(継承元 Type)
GetGenericArguments()

ジェネリック型パラメーターでは使用できません。

GetGenericArguments()

動的に定義されているジェネリック型のジェネリック型パラメーターとメソッドを定義して作成します。 このクラスは継承できません。

(継承元 TypeInfo)
GetGenericParameterConstraints()

動的に定義されているジェネリック型のジェネリック型パラメーターとメソッドを定義して作成します。 このクラスは継承できません。

GetGenericParameterConstraints()

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

(継承元 Type)
GetGenericParameterConstraints()

動的に定義されているジェネリック型のジェネリック型パラメーターとメソッドを定義して作成します。 このクラスは継承できません。

(継承元 TypeInfo)
GetGenericTypeDefinition()

ジェネリック型パラメーターでは使用できません。

GetHashCode()

現在のインスタンスの 32 ビット整数ハッシュ コードを返します。

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)
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)

常に NotSupportedException 例外をスローします。

IsAssignableFrom(Type)

動的に定義されているジェネリック型のジェネリック型パラメーターとメソッドを定義して作成します。 このクラスは継承できません。

(継承元 TypeInfo)
IsAssignableFrom(TypeInfo)

常に NotSupportedException 例外をスローします。

IsAssignableTo(Type)

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

(継承元 Type)
IsByRefImpl()

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

IsByRefImpl()

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

(継承元 Type)
IsCOMObjectImpl()

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

IsCOMObjectImpl()

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

(継承元 Type)
IsContextfulImpl()

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

(継承元 Type)
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)

不完全なジェネリック型パラメーターではサポートされていません。

IsValueTypeImpl()

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

IsValueTypeImpl()

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

(継承元 Type)
MakeArrayType()

要素型がジェネリック型パラメーターである 1 次元配列の型を返します。

MakeArrayType(Int32)

要素型がジェネリック型パラメーターで、指定の次元数の配列型を返します。

MakeByRefType()

参照パラメーターとして渡されるときに現在のジェネリック型パラメーターを表す Type オブジェクトを返します。

MakeGenericType(Type[])

不完全なジェネリック型パラメーターでは使用できません。

MakePointerType()

現在のジェネリック型パラメーターを指すポインターを表す Type オブジェクトを返します。

MemberwiseClone()

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

(継承元 Object)
SetBaseTypeConstraint(Type)

型パラメーターの代わりに使用するために、型が継承する必要のある基本データ型を設定します。

SetBaseTypeConstraintCore(Type)

派生クラスでオーバーライドされた場合、型パラメーターに置き換えるために型が継承する必要がある基本型を設定します。

SetCustomAttribute(ConstructorInfo, Byte[])

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

SetCustomAttribute(CustomAttributeBuilder)

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

SetCustomAttributeCore(ConstructorInfo, ReadOnlySpan<Byte>)

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

SetGenericParameterAttributes(GenericParameterAttributes)

パラメーターなしのコンストラクター制約など、ジェネリック パラメーターの分散特性および特殊な制約を設定します。

SetGenericParameterAttributesCore(GenericParameterAttributes)

派生クラスでオーバーライドされた場合は、パラメーターなしのコンストラクター制約など、ジェネリック パラメーターの分散特性と特別な制約を設定します。

SetInterfaceConstraints(Type[])

型パラメーターを置き換えるために、型において実装する必要のあるインターフェイスを設定します。

SetInterfaceConstraintsCore(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)
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)

動的に定義されているジェネリック型のジェネリック型パラメーターとメソッドを定義して作成します。 このクラスは継承できません。

適用対象

こちらもご覧ください