PropertyBuilder クラス

定義

型のプロパティを定義します。

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

次のコード サンプルでは、 を使用して動的型にプロパティを実装し、 を使用してPropertyBuilderTypeBuilder.DefinePropertyプロパティ フレームワークを作成し、 プロパティ内に IL ロジックを実装するために関連付ける MethodBuilder 方法を示します。

using namespace System;
using namespace System::Threading;
using namespace System::Reflection;
using namespace System::Reflection::Emit;
Type^ BuildDynamicTypeWithProperties()
{
   AppDomain^ myDomain = Thread::GetDomain();
   AssemblyName^ myAsmName = gcnew AssemblyName;
   myAsmName->Name = "MyDynamicAssembly";
   
   // To generate a persistable assembly, specify AssemblyBuilderAccess::RunAndSave.
   AssemblyBuilder^ myAsmBuilder = 
       myDomain->DefineDynamicAssembly( myAsmName, AssemblyBuilderAccess::RunAndSave );
   
   // Generate a persistable single-module assembly.
   ModuleBuilder^ myModBuilder = 
       myAsmBuilder->DefineDynamicModule( myAsmName->Name, myAsmName->Name + ".dll" );
   TypeBuilder^ myTypeBuilder = myModBuilder->DefineType( "CustomerData", TypeAttributes::Public );

   // Define a private field to hold the property value.
   FieldBuilder^ customerNameBldr = myTypeBuilder->DefineField( "customerName", String::typeid, FieldAttributes::Private );
   
   // The last argument of DefineProperty is an empty array of Type
   // objects, because the property has no parameters. (Alternatively,
   // you can specify a null value.)
   PropertyBuilder^ custNamePropBldr = 
       myTypeBuilder->DefineProperty( "CustomerName", PropertyAttributes::HasDefault, String::typeid, gcnew array<Type^>(0) );
   
   // 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 CustomerName.
   MethodBuilder^ custNameGetPropMthdBldr = 
       myTypeBuilder->DefineMethod( "get_CustomerName", 
                                    getSetAttr,
                                    String::typeid, 
                                    Type::EmptyTypes );

   ILGenerator^ custNameGetIL = custNameGetPropMthdBldr->GetILGenerator();
   custNameGetIL->Emit( OpCodes::Ldarg_0 );
   custNameGetIL->Emit( OpCodes::Ldfld, customerNameBldr );
   custNameGetIL->Emit( OpCodes::Ret );
   
   // Define the "set" accessor method for CustomerName.
   array<Type^>^temp2 = {String::typeid};
   MethodBuilder^ custNameSetPropMthdBldr = 
       myTypeBuilder->DefineMethod( "set_CustomerName", 
                                    getSetAttr,
                                    nullptr, 
                                    temp2 );

   ILGenerator^ custNameSetIL = custNameSetPropMthdBldr->GetILGenerator();
   custNameSetIL->Emit( OpCodes::Ldarg_0 );
   custNameSetIL->Emit( OpCodes::Ldarg_1 );
   custNameSetIL->Emit( OpCodes::Stfld, customerNameBldr );
   custNameSetIL->Emit( OpCodes::Ret );
   
   // Last, we must map the two methods created above to our PropertyBuilder to
   // their corresponding behaviors, "get" and "set" respectively.
   custNamePropBldr->SetGetMethod( custNameGetPropMthdBldr );
   custNamePropBldr->SetSetMethod( custNameSetPropMthdBldr );

   Type^ retval = myTypeBuilder->CreateType();

   // Save the assembly so it can be examined with Ildasm.exe,
   // or referenced by a test program.
   myAsmBuilder->Save(myAsmName->Name + ".dll");
   return retval;
}

int main()
{
   Type^ custDataType = BuildDynamicTypeWithProperties();
   array<PropertyInfo^>^custDataPropInfo = custDataType->GetProperties();
   System::Collections::IEnumerator^ myEnum = custDataPropInfo->GetEnumerator();
   while ( myEnum->MoveNext() )
   {
      PropertyInfo^ pInfo = safe_cast<PropertyInfo^>(myEnum->Current);
      Console::WriteLine( "Property '{0}' created!", pInfo );
   }

   Console::WriteLine( "---" );
   
   // Note that when invoking a property, you need to use the proper BindingFlags -
   // BindingFlags::SetProperty when you invoke the "set" behavior, and
   // BindingFlags::GetProperty when you invoke the "get" behavior. Also note that
   // we invoke them based on the name we gave the property, as expected, and not
   // the name of the methods we bound to the specific property behaviors.
   Object^ custData = Activator::CreateInstance( custDataType );
   array<Object^>^temp3 = {"Joe User"};
   custDataType->InvokeMember( "CustomerName", BindingFlags::SetProperty, nullptr, custData, temp3 );
   Console::WriteLine( "The customerName field of instance custData has been set to '{0}'.", custDataType->InvokeMember( "CustomerName", BindingFlags::GetProperty, nullptr, custData, gcnew array<Object^>(0) ) );
}

// --- O U T P U T ---
// The output should be as follows:
// -------------------
// Property 'System.String CustomerName' created!
// ---
// The customerName field of instance custData has been set to 'Joe User'.
// -------------------
using System;
using System.Threading;
using System.Reflection;
using System.Reflection.Emit;

class PropertyBuilderDemo
{
   public static Type BuildDynamicTypeWithProperties()
   {
        AppDomain myDomain = Thread.GetDomain();
        AssemblyName myAsmName = new AssemblyName();
        myAsmName.Name = "MyDynamicAssembly";

        // To generate a persistable assembly, specify AssemblyBuilderAccess.RunAndSave.
        AssemblyBuilder myAsmBuilder = myDomain.DefineDynamicAssembly(myAsmName,
                                                        AssemblyBuilderAccess.RunAndSave);
        // Generate a persistable single-module assembly.
        ModuleBuilder myModBuilder =
            myAsmBuilder.DefineDynamicModule(myAsmName.Name, myAsmName.Name + ".dll");

        TypeBuilder myTypeBuilder = myModBuilder.DefineType("CustomerData",
                                                        TypeAttributes.Public);

        FieldBuilder customerNameBldr = myTypeBuilder.DefineField("customerName",
                                                        typeof(string),
                                                        FieldAttributes.Private);

        // 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 an array with no elements: new Type[] {})
        PropertyBuilder custNamePropBldr = myTypeBuilder.DefineProperty("CustomerName",
                                                         PropertyAttributes.HasDefault,
                                                         typeof(string),
                                                         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 CustomerName.
        MethodBuilder custNameGetPropMthdBldr =
            myTypeBuilder.DefineMethod("get_CustomerName",
                                       getSetAttr,
                                       typeof(string),
                                       Type.EmptyTypes);

        ILGenerator custNameGetIL = custNameGetPropMthdBldr.GetILGenerator();

        custNameGetIL.Emit(OpCodes.Ldarg_0);
        custNameGetIL.Emit(OpCodes.Ldfld, customerNameBldr);
        custNameGetIL.Emit(OpCodes.Ret);

        // Define the "set" accessor method for CustomerName.
        MethodBuilder custNameSetPropMthdBldr =
            myTypeBuilder.DefineMethod("set_CustomerName",
                                       getSetAttr,
                                       null,
                                       new Type[] { typeof(string) });

        ILGenerator custNameSetIL = custNameSetPropMthdBldr.GetILGenerator();

        custNameSetIL.Emit(OpCodes.Ldarg_0);
        custNameSetIL.Emit(OpCodes.Ldarg_1);
        custNameSetIL.Emit(OpCodes.Stfld, customerNameBldr);
        custNameSetIL.Emit(OpCodes.Ret);

        // Last, we must map the two methods created above to our PropertyBuilder to
        // their corresponding behaviors, "get" and "set" respectively.
        custNamePropBldr.SetGetMethod(custNameGetPropMthdBldr);
        custNamePropBldr.SetSetMethod(custNameSetPropMthdBldr);

        Type retval = myTypeBuilder.CreateType();

        // Save the assembly so it can be examined with Ildasm.exe,
        // or referenced by a test program.
        myAsmBuilder.Save(myAsmName.Name + ".dll");
        return retval;
   }

   public static void Main()
   {
        Type custDataType = BuildDynamicTypeWithProperties();

        PropertyInfo[] custDataPropInfo = custDataType.GetProperties();
        foreach (PropertyInfo pInfo in custDataPropInfo) {
           Console.WriteLine("Property '{0}' created!", pInfo.ToString());
        }

        Console.WriteLine("---");
        // Note that when invoking a property, you need to use the proper BindingFlags -
        // BindingFlags.SetProperty when you invoke the "set" behavior, and
        // BindingFlags.GetProperty when you invoke the "get" behavior. Also note that
        // we invoke them based on the name we gave the property, as expected, and not
        // the name of the methods we bound to the specific property behaviors.

        object custData = Activator.CreateInstance(custDataType);
        custDataType.InvokeMember("CustomerName", BindingFlags.SetProperty,
                                      null, custData, new object[]{ "Joe User" });

        Console.WriteLine("The customerName field of instance custData has been set to '{0}'.",
                           custDataType.InvokeMember("CustomerName", BindingFlags.GetProperty,
                                                      null, custData, new object[]{ }));
   }
}

// --- O U T P U T ---
// The output should be as follows:
// -------------------
// Property 'System.String CustomerName' created!
// ---
// The customerName field of instance custData has been set to 'Joe User'.
// -------------------
Imports System.Threading
Imports System.Reflection
Imports System.Reflection.Emit

Class PropertyBuilderDemo
   
   Public Shared Function BuildDynamicTypeWithProperties() As Type
      Dim myDomain As AppDomain = Thread.GetDomain()
      Dim myAsmName As New AssemblyName()
      myAsmName.Name = "MyDynamicAssembly"
      
      ' To generate a persistable assembly, specify AssemblyBuilderAccess.RunAndSave.
      Dim myAsmBuilder As AssemblyBuilder = myDomain.DefineDynamicAssembly(myAsmName, _
                                                        AssemblyBuilderAccess.RunAndSave)
      
      ' Generate a persistable, single-module assembly.
      Dim myModBuilder As ModuleBuilder = _
          myAsmBuilder.DefineDynamicModule(myAsmName.Name, myAsmName.Name & ".dll")
      
      Dim myTypeBuilder As TypeBuilder = myModBuilder.DefineType("CustomerData", TypeAttributes.Public)
      
      ' Define a private field to hold the property value.
      Dim customerNameBldr As FieldBuilder = myTypeBuilder.DefineField("customerName", _
                                             GetType(String), FieldAttributes.Private)
      
      ' 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 an array with no elements: New Type() {})
      Dim custNamePropBldr As PropertyBuilder = _
          myTypeBuilder.DefineProperty("CustomerName", _
                                       PropertyAttributes.HasDefault, _
                                       GetType(String), _
                                       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 CustomerName.
      Dim custNameGetPropMthdBldr As MethodBuilder = _
          myTypeBuilder.DefineMethod("GetCustomerName", _
                                     getSetAttr, _
                                     GetType(String), _
                                     Type.EmptyTypes)
      
      Dim custNameGetIL As ILGenerator = custNameGetPropMthdBldr.GetILGenerator()
      
      custNameGetIL.Emit(OpCodes.Ldarg_0)
      custNameGetIL.Emit(OpCodes.Ldfld, customerNameBldr)
      custNameGetIL.Emit(OpCodes.Ret)
      
      ' Define the "set" accessor method for CustomerName.
      Dim custNameSetPropMthdBldr As MethodBuilder = _
          myTypeBuilder.DefineMethod("get_CustomerName", _
                                     getSetAttr, _
                                     Nothing, _
                                     New Type() {GetType(String)})
      
      Dim custNameSetIL As ILGenerator = custNameSetPropMthdBldr.GetILGenerator()
      
      custNameSetIL.Emit(OpCodes.Ldarg_0)
      custNameSetIL.Emit(OpCodes.Ldarg_1)
      custNameSetIL.Emit(OpCodes.Stfld, customerNameBldr)
      custNameSetIL.Emit(OpCodes.Ret)
      
      ' Last, we must map the two methods created above to our PropertyBuilder to 
      ' their corresponding behaviors, "get" and "set" respectively. 
      custNamePropBldr.SetGetMethod(custNameGetPropMthdBldr)
      custNamePropBldr.SetSetMethod(custNameSetPropMthdBldr)
            
      Dim retval As Type = myTypeBuilder.CreateType()

      ' Save the assembly so it can be examined with Ildasm.exe,
      ' or referenced by a test program.
      myAsmBuilder.Save(myAsmName.Name & ".dll")
      return retval
   End Function 'BuildDynamicTypeWithProperties
    
   
   Public Shared Sub Main()
      Dim custDataType As Type = BuildDynamicTypeWithProperties()
      
      Dim custDataPropInfo As PropertyInfo() = custDataType.GetProperties()
      Dim pInfo As PropertyInfo
      For Each pInfo In  custDataPropInfo
         Console.WriteLine("Property '{0}' created!", pInfo.ToString())
      Next pInfo
      
      Console.WriteLine("---")
      ' Note that when invoking a property, you need to use the proper BindingFlags -
      ' BindingFlags.SetProperty when you invoke the "set" behavior, and 
      ' BindingFlags.GetProperty when you invoke the "get" behavior. Also note that
      ' we invoke them based on the name we gave the property, as expected, and not
      ' the name of the methods we bound to the specific property behaviors.
      Dim custData As Object = Activator.CreateInstance(custDataType)
      custDataType.InvokeMember("CustomerName", BindingFlags.SetProperty, Nothing, _
                                custData, New Object() {"Joe User"})
      
      Console.WriteLine("The customerName field of instance custData has been set to '{0}'.", _
                        custDataType.InvokeMember("CustomerName", BindingFlags.GetProperty, _
                        Nothing, custData, New Object() {}))
   End Sub
End Class


' --- O U T P U T ---
' The output should be as follows:
' -------------------
' Property 'System.String CustomerName' created!
' ---
' The customerName field of instance custData has been set to 'Joe User'.
' -------------------

注釈

PropertyBuilder 常に に TypeBuilder関連付けられます。 TypeBuilderDefineProperty メソッドは新しい を PropertyBuilder クライアントに返します。

コンストラクター

PropertyBuilder()

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

プロパティ

Attributes

このプロパティの属性を取得します。

CanRead

プロパティを読み取ることができるかどうかを示す値を取得します。

CanWrite

プロパティに書き込むことができるかどうかを示す値を取得します。

CustomAttributes

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

(継承元 MemberInfo)
DeclaringType

このメンバーを宣言するクラスを取得します。

GetMethod

このプロパティの get アクセサーを取得します。

(継承元 PropertyInfo)
IsCollectible

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

(継承元 MemberInfo)
IsSpecialName

特別な名前のプロパティかどうかを示す値を取得します。

(継承元 PropertyInfo)
MemberType

このメンバーがプロパティであることを示す MemberTypes 値を取得します。

(継承元 PropertyInfo)
MetadataToken

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

(継承元 MemberInfo)
Module

現在のプロパティを宣言している型が定義されているモジュールを取得します。

Module

現在の MemberInfo によって表されるメンバーを宣言する型が定義されているモジュールを取得します。

(継承元 MemberInfo)
Name

このメンバーの名前を取得します。

PropertyToken

このプロパティのトークンを取得します。

PropertyType

このプロパティのフィールドの型を取得します。

ReflectedType

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

ReflectedType

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

(継承元 MemberInfo)
SetMethod

このプロパティの set アクセサーを取得します。

(継承元 PropertyInfo)

メソッド

AddOtherMethod(MethodBuilder)

このプロパティに関連付ける別のメソッドを追加します。

AddOtherMethodCore(MethodBuilder)

派生クラスでオーバーライドされると、このプロパティに関連付けられている他のメソッドのいずれかを追加します。

Equals(Object)

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

(継承元 PropertyInfo)
GetAccessors()

現在のインスタンスがリフレクションしているプロパティの、パブリックな get アクセサー、および set アクセサーをリフレクションする要素で構成される配列を返します。

(継承元 PropertyInfo)
GetAccessors(Boolean)

このプロパティのパブリックおよび非パブリックな get アクセサーと set アクセサーの配列を返します。

GetAccessors(Boolean)

現在のインスタンスがリフレクションしているプロパティのパブリックな (指定された場合は非パブリックも) get アクセサー、および set アクセサーをリフレクションする要素で構成される配列を返します。

(継承元 PropertyInfo)
GetConstantValue()

コンパイラによってプロパティに関連付けられているリテラル値を返します。

(継承元 PropertyInfo)
GetCustomAttributes(Boolean)

このプロパティのすべてのカスタム属性の配列を返します。

GetCustomAttributes(Boolean)

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

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

Type によって識別されるカスタム属性の配列を返します。

GetCustomAttributes(Type, Boolean)

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

(継承元 MemberInfo)
GetCustomAttributesData()

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

(継承元 MemberInfo)
GetGetMethod()

このプロパティのパブリックな get アクセサーを返します。

(継承元 PropertyInfo)
GetGetMethod(Boolean)

このプロパティのパブリックおよび非パブリックな get アクセサーを返します。

GetGetMethod(Boolean)

派生クラス内でオーバーライドされた場合に、このプロパティのパブリックまたは非パブリックな get アクセサーを返します。

(継承元 PropertyInfo)
GetHashCode()

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

(継承元 PropertyInfo)
GetIndexParameters()

プロパティのすべてのインデックス パラメーターの配列を返します。

GetModifiedPropertyType()

このプロパティ オブジェクトの変更された型を取得します。

(継承元 PropertyInfo)
GetOptionalCustomModifiers()

プロパティのオプションのカスタム修飾子を表す型の配列を返します。

(継承元 PropertyInfo)
GetRawConstantValue()

コンパイラによってプロパティに関連付けられているリテラル値を返します。

(継承元 PropertyInfo)
GetRequiredCustomModifiers()

プロパティの必須のカスタム修飾子を表す型の配列を返します。

(継承元 PropertyInfo)
GetSetMethod()

このプロパティのパブリックな set アクセサーを返します。

(継承元 PropertyInfo)
GetSetMethod(Boolean)

このプロパティの set アクセサーを返します。

GetSetMethod(Boolean)

派生クラス内でオーバーライドされた場合に、このプロパティの set アクセサーを返します。

(継承元 PropertyInfo)
GetType()

プロパティの属性を取得し、プロパティのメタデータにアクセスできるようにします。

(継承元 PropertyInfo)
GetValue(Object)

指定されたオブジェクトのプロパティ値を返します。

(継承元 PropertyInfo)
GetValue(Object, BindingFlags, Binder, Object[], CultureInfo)

指定したバインディング、インデックス、および CultureInfo のプロパティの値を取得します。

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

派生クラスでオーバーライドされると、指定したバインディング、インデックス、およびカルチャ固有の情報を含む指定されたオブジェクトのプロパティ値を返します。

(継承元 PropertyInfo)
GetValue(Object, Object[])

プロパティの取得側メソッドを呼び出して、インデックス付きプロパティの値を取得します。

HasSameMetadataDefinitionAs(MemberInfo)

型のプロパティを定義します。

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

このプロパティに attributeType のインスタンスが 1 つ以上定義されているかどうかを示します。

IsDefined(Type, Boolean)

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

(継承元 MemberInfo)
MemberwiseClone()

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

(継承元 Object)
SetConstant(Object)

このプロパティの既定値を設定します。

SetConstantCore(Object)

派生クラスでオーバーライドされた場合は、このプロパティの既定値を設定します。

SetCustomAttribute(ConstructorInfo, Byte[])

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

SetCustomAttribute(CustomAttributeBuilder)

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

SetCustomAttributeCore(ConstructorInfo, ReadOnlySpan<Byte>)

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

SetGetMethod(MethodBuilder)

プロパティ値を取得するメソッドを設定します。

SetGetMethodCore(MethodBuilder)

派生クラスでオーバーライドされた場合は、プロパティ値を取得するメソッドを設定します。

SetSetMethod(MethodBuilder)

プロパティ値を設定するメソッドを設定します。

SetSetMethodCore(MethodBuilder)

派生クラスでオーバーライドされた場合は、プロパティ値を設定するメソッドを設定します。

SetValue(Object, Object)

指定されたオブジェクトのプロパティの値を設定します。

(継承元 PropertyInfo)
SetValue(Object, Object, BindingFlags, Binder, Object[], CultureInfo)

指定したオブジェクトのプロパティ値に、指定した値を設定します。

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

派生クラスでオーバーライドされると、指定したバインディング、インデックス、およびカルチャ固有の情報を含む指定されたオブジェクトのプロパティ値を設定します。

(継承元 PropertyInfo)
SetValue(Object, Object, Object[])

プロパティの値を設定します。インデックス付きプロパティの場合は、オプションでインデックス値を設定できます。

ToString()

現在のオブジェクトを表す文字列を返します。

(継承元 Object)

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

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

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

_PropertyBuilder.GetTypeInfo(UInt32, UInt32, IntPtr)

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

_PropertyBuilder.GetTypeInfoCount(UInt32)

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

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

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

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

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

(継承元 PropertyInfo)
_PropertyInfo.GetType()

Type 型を表す PropertyInfo オブジェクトを取得します。

(継承元 PropertyInfo)
_PropertyInfo.GetTypeInfo(UInt32, UInt32, IntPtr)

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

(継承元 PropertyInfo)
_PropertyInfo.GetTypeInfoCount(UInt32)

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

(継承元 PropertyInfo)
_PropertyInfo.Invoke(UInt32, Guid, UInt32, Int16, IntPtr, IntPtr, IntPtr, IntPtr)

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

(継承元 PropertyInfo)
ICustomAttributeProvider.GetCustomAttributes(Boolean)

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

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

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

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

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

(継承元 MemberInfo)

拡張メソッド

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)

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

GetMetadataToken(MemberInfo)

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

HasMetadataToken(MemberInfo)

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

GetAccessors(PropertyInfo)

型のプロパティを定義します。

GetAccessors(PropertyInfo, Boolean)

型のプロパティを定義します。

GetGetMethod(PropertyInfo)

型のプロパティを定義します。

GetGetMethod(PropertyInfo, Boolean)

型のプロパティを定義します。

GetSetMethod(PropertyInfo)

型のプロパティを定義します。

GetSetMethod(PropertyInfo, Boolean)

型のプロパティを定義します。

適用対象