PropertyBuilderとは? わかりやすく解説

PropertyBuilder クラス

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

名前空間: System.Reflection.Emit
アセンブリ: mscorlib (mscorlib.dll 内)
構文構文

<ClassInterfaceAttribute(ClassInterfaceType.None)> _
<ComVisibleAttribute(True)> _
Public NotInheritable Class
 PropertyBuilder
    Inherits PropertyInfo
    Implements _PropertyBuilder
Dim instance As PropertyBuilder
[ClassInterfaceAttribute(ClassInterfaceType.None)] 
[ComVisibleAttribute(true)] 
public sealed class PropertyBuilder : PropertyInfo,
 _PropertyBuilder
[ClassInterfaceAttribute(ClassInterfaceType::None)] 
[ComVisibleAttribute(true)] 
public ref class PropertyBuilder sealed : public
 PropertyInfo, _PropertyBuilder
/** @attribute ClassInterfaceAttribute(ClassInterfaceType.None) */ 
/** @attribute ComVisibleAttribute(true) */ 
public final class PropertyBuilder extends
 PropertyInfo implements _PropertyBuilder
ClassInterfaceAttribute(ClassInterfaceType.None) 
ComVisibleAttribute(true) 
public final class PropertyBuilder extends
 PropertyInfo implements _PropertyBuilder
解説解説
メモメモ

このクラスに適用される HostProtectionAttribute 属性の Resources プロパティの値は、MayLeakOnAbort です。HostProtectionAttribute は、デスクトップ アプリケーション (一般的には、アイコンをダブルクリック、コマンドを入力、またはブラウザに URL を入力して起動するアプリケーション) には影響しません。詳細については、HostProtectionAttribute クラスのトピックまたは「SQL Server プログラミングとホスト保護属性」を参照してください。

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

使用例使用例

TypeBuilder.DefineProperty を使用して PropertyBuilder を取得し、これを使用して動的な型でプロパティを実装し、プロパティ内に IL ロジックを実装する関連 MethodBuilder とプロパティ フレームワークを作成する方法を次のコード例に示します。

Imports System
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 'Main
End Class 'PropertyBuilderDemo


' --- O U T P U T ---
' The output should be as follows:
' -------------------
' Property 'System.String CustomerName [System.String]' 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 [System.String]' created!
// ---
// The customerName field of instance custData has been set to 'Joe
 User'.
// -------------------

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 [System.String]' created!
// ---
// The customerName field of instance custData has been set to 'Joe
 User'.
// -------------------
継承階層継承階層
System.Object
   System.Reflection.MemberInfo
     System.Reflection.PropertyInfo
      System.Reflection.Emit.PropertyBuilder
スレッド セーフスレッド セーフ
この型の public static (Visual Basic では Shared) メンバはすべて、スレッド セーフです。インスタンス メンバの場合は、スレッド セーフであるとは限りません。
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
PropertyBuilder メンバ
System.Reflection.Emit 名前空間

PropertyBuilder プロパティ


パブリック プロパティパブリック プロパティ

  名前 説明
パブリック プロパティ Attributes オーバーライドされます。 このプロパティの属性を取得します。
パブリック プロパティ CanRead オーバーライドされます。 プロパティを読み取ることができるかどうかを示す値を取得します。
パブリック プロパティ CanWrite オーバーライドされます。 プロパティに書き込むことができるかどうかを示す値を取得します。
パブリック プロパティ DeclaringType オーバーライドされます。 このメンバを宣言するクラスを取得します。
パブリック プロパティ IsSpecialName  特別な名前のプロパティかどうかを示す値を取得します。 ( PropertyInfo から継承されます。)
パブリック プロパティ MemberType  このメンバがプロパティであることを示す MemberTypes 値を取得します。 ( PropertyInfo から継承されます。)
パブリック プロパティ MetadataToken  メタデータ要素を識別する値を取得します。 ( MemberInfo から継承されます。)
パブリック プロパティ Module オーバーライドされます。 現在のプロパティを宣言している型が定義されているモジュールを取得します。
パブリック プロパティ Name オーバーライドされます。 このメンバの名前を取得します。
パブリック プロパティ PropertyToken このプロパティのトークンを取得します。
パブリック プロパティ PropertyType オーバーライドされます。 このプロパティのフィールドの型を取得します。
パブリック プロパティ ReflectedType オーバーライドされます。 MemberInfo のこのインスタンスを取得するために使用したクラス オブジェクトを取得します。
参照参照

関連項目

PropertyBuilder クラス
System.Reflection.Emit 名前空間

PropertyBuilder メソッド


パブリック メソッドパブリック メソッド

  名前 説明
パブリック メソッド AddOtherMethod このプロパティに関連付ける別のメソッドを追加します。
パブリック メソッド Equals  オーバーロードされます。 2 つの Object インスタンスが等しいかどうかを判断します。 ( Object から継承されます。)
パブリック メソッド GetAccessors オーバーロードされます。 このプロパティの get アクセサと set アクセサの配列を返します。
パブリック メソッド GetConstantValue  コンパイラによってプロパティに関連付けられているリテラル値を返します。 ( PropertyInfo から継承されます。)
パブリック メソッド GetCustomAttributes オーバーロードされます。 オーバーライドされます。 このプロパティに定義されているすべてのカスタム属性を返します。
パブリック メソッド GetGetMethod オーバーロードされます。 このプロパティの get アクセサ メソッドを返します。
パブリック メソッド GetHashCode  特定の型のハッシュ関数として機能します。GetHashCode は、ハッシュ アルゴリズムや、ハッシュ テーブルのようなデータ構造での使用に適しています。 ( Object から継承されます。)
パブリック メソッド GetIndexParameters オーバーライドされます。 プロパティのすべてのインデックス パラメータの配列を返します。
パブリック メソッド GetOptionalCustomModifiers  プロパティのオプションのカスタム修飾子を表す型の配列を返します。 ( PropertyInfo から継承されます。)
パブリック メソッド GetRawConstantValue  コンパイラによってプロパティに関連付けられているリテラル値を返します。 ( PropertyInfo から継承されます。)
パブリック メソッド GetRequiredCustomModifiers  プロパティの必須のカスタム修飾子を表す型の配列を返します。 ( PropertyInfo から継承されます。)
パブリック メソッド GetSetMethod オーバーロードされます。 このプロパティの set アクセサ メソッドを返します。
パブリック メソッド GetType  現在のインスタンスの Type を取得します。 ( Object から継承されます。)
パブリック メソッド GetValue オーバーロードされます。 オーバーライドされます。 取得関数を呼び出してプロパティの値を取得します。
パブリック メソッド IsDefined オーバーライドされます。 このプロパティに attributeType のインスタンスが 1 つ以上定義されているかどうかを示します。
パブリック メソッド ReferenceEquals  指定した複数の Object インスタンスが同一かどうかを判断します。 ( Object から継承されます。)
パブリック メソッド SetConstant このプロパティの既定値を設定します。
パブリック メソッド SetCustomAttribute オーバーロードされます。 カスタム属性を設定します。
パブリック メソッド SetGetMethod プロパティ値を取得するメソッドを設定します。
パブリック メソッド SetSetMethod プロパティ値を設定するメソッドを設定します。
パブリック メソッド SetValue オーバーロードされます。 オーバーライドされます。 指定したオブジェクトのプロパティ値に、指定した値を設定します。
パブリック メソッド ToString  現在の Object を表す String を返します。 ( Object から継承されます。)
明示的インターフェイスの実装明示的インターフェイスの実装
  名前 説明
インターフェイスの明示的な実装 System.Runtime.InteropServices._PropertyBuilder.GetIDsOfNames 名前のセットを対応するディスパッチ識別子のセットに割り当てます。
インターフェイスの明示的な実装 System.Runtime.InteropServices._PropertyBuilder.GetTypeInfo オブジェクトの型情報を取得します。この型情報は、インターフェイスの型情報を取得するために使用できます。
インターフェイスの明示的な実装 System.Runtime.InteropServices._PropertyBuilder.GetTypeInfoCount オブジェクトが提供する型情報インターフェイスの数を取得します (0 または 1)。
インターフェイスの明示的な実装 System.Runtime.InteropServices._PropertyBuilder.Invoke オブジェクトによって公開されているプロパティおよびメソッドにアクセスできるようにします。
参照参照

関連項目

PropertyBuilder クラス
System.Reflection.Emit 名前空間

PropertyBuilder メンバ

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

PropertyBuilder データ型で公開されるメンバを以下の表に示します。


パブリック プロパティパブリック プロパティ
  名前 説明
パブリック プロパティ Attributes オーバーライドされます。 このプロパティの属性を取得します。
パブリック プロパティ CanRead オーバーライドされます。 プロパティを読み取ることができるかどうかを示す値を取得します。
パブリック プロパティ CanWrite オーバーライドされます。 プロパティに書き込むことができるかどうかを示す値を取得します。
パブリック プロパティ DeclaringType オーバーライドされます。 このメンバを宣言するクラスを取得します。
パブリック プロパティ IsSpecialName  特別な名前のプロパティかどうかを示す値を取得します。(PropertyInfo から継承されます。)
パブリック プロパティ MemberType  このメンバがプロパティであることを示す MemberTypes 値を取得します。(PropertyInfo から継承されます。)
パブリック プロパティ MetadataToken  メタデータ要素を識別する値を取得します。(MemberInfo から継承されます。)
パブリック プロパティ Module オーバーライドされます。 現在のプロパティを宣言している型が定義されているモジュールを取得します。
パブリック プロパティ Name オーバーライドされます。 このメンバの名前を取得します。
パブリック プロパティ PropertyToken このプロパティのトークンを取得します。
パブリック プロパティ PropertyType オーバーライドされます。 このプロパティのフィールドの型を取得します。
パブリック プロパティ ReflectedType オーバーライドされます。 MemberInfo のこのインスタンスを取得するために使用したクラス オブジェクトを取得します。
パブリック メソッドパブリック メソッド
  名前 説明
パブリック メソッド AddOtherMethod このプロパティに関連付ける別のメソッドを追加します。
パブリック メソッド Equals  オーバーロードされます。 2 つの Object インスタンスが等しいかどうかを判断します。 (Object から継承されます。)
パブリック メソッド GetAccessors オーバーロードされます。 このプロパティの get アクセサと set アクセサの配列を返します。
パブリック メソッド GetConstantValue  コンパイラによってプロパティに関連付けられているリテラル値を返します。 (PropertyInfo から継承されます。)
パブリック メソッド GetCustomAttributes オーバーロードされます。 オーバーライドされます。 このプロパティに定義されているすべてのカスタム属性を返します。
パブリック メソッド GetGetMethod オーバーロードされます。 このプロパティの get アクセサ メソッドを返します。
パブリック メソッド GetHashCode  特定の型のハッシュ関数として機能します。GetHashCode は、ハッシュ アルゴリズムや、ハッシュ テーブルのようなデータ構造での使用に適しています。 (Object から継承されます。)
パブリック メソッド GetIndexParameters オーバーライドされます。 プロパティのすべてのインデックス パラメータの配列を返します。
パブリック メソッド GetOptionalCustomModifiers  プロパティのオプションのカスタム修飾子を表す型の配列を返します。 (PropertyInfo から継承されます。)
パブリック メソッド GetRawConstantValue  コンパイラによってプロパティに関連付けられているリテラル値を返します。 (PropertyInfo から継承されます。)
パブリック メソッド GetRequiredCustomModifiers  プロパティの必須のカスタム修飾子を表す型の配列を返します。 (PropertyInfo から継承されます。)
パブリック メソッド GetSetMethod オーバーロードされます。 このプロパティの set アクセサ メソッドを返します。
パブリック メソッド GetType  現在のインスタンスの Type を取得します。 (Object から継承されます。)
パブリック メソッド GetValue オーバーロードされます。 オーバーライドされます。 取得関数を呼び出してプロパティの値を取得します。
パブリック メソッド IsDefined オーバーライドされます。 このプロパティに attributeType のインスタンスが 1 つ以上定義されているかどうかを示します。
パブリック メソッド ReferenceEquals  指定した複数の Object インスタンスが同一かどうかを判断します。 (Object から継承されます。)
パブリック メソッド SetConstant このプロパティの既定値を設定します。
パブリック メソッド SetCustomAttribute オーバーロードされます。 カスタム属性を設定します。
パブリック メソッド SetGetMethod プロパティ値を取得するメソッドを設定します。
パブリック メソッド SetSetMethod プロパティ値を設定するメソッドを設定します。
パブリック メソッド SetValue オーバーロードされます。 オーバーライドされます。 指定したオブジェクトのプロパティ値に、指定した値を設定します。
パブリック メソッド ToString  現在の Object を表す String を返します。 (Object から継承されます。)
明示的インターフェイスの実装明示的インターフェイスの実装
  名前 説明
インターフェイスの明示的な実装 System.Runtime.InteropServices._PropertyBuilder.GetIDsOfNames 名前のセットを対応するディスパッチ識別子のセットに割り当てます。
インターフェイスの明示的な実装 System.Runtime.InteropServices._PropertyBuilder.GetTypeInfo オブジェクトの型情報を取得します。この型情報は、インターフェイスの型情報を取得するために使用できます。
インターフェイスの明示的な実装 System.Runtime.InteropServices._PropertyBuilder.GetTypeInfoCount オブジェクトが提供する型情報インターフェイスの数を取得します (0 または 1)。
インターフェイスの明示的な実装 System.Runtime.InteropServices._PropertyBuilder.Invoke オブジェクトによって公開されているプロパティおよびメソッドにアクセスできるようにします。
参照参照

関連項目

PropertyBuilder クラス
System.Reflection.Emit 名前空間

_PropertyBuilder インターフェイス

メモ : このインターフェイスは、.NET Framework version 2.0 で新しく追加されたものです。

System.Reflection.Emit.PropertyBuilder クラスをアンマネージ コードに公開します。

 

名前空間: System.Runtime.InteropServices
アセンブリ: mscorlib (mscorlib.dll 内)
構文構文

<InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIUnknown)> _
<GuidAttribute("15F9A479-9397-3A63-ACBD-F51977FB0F02")>
 _
<CLSCompliantAttribute(False)> _
<ComVisibleAttribute(True)> _
Public Interface _PropertyBuilder
Dim instance As _PropertyBuilder
[InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIUnknown)] 
[GuidAttribute("15F9A479-9397-3A63-ACBD-F51977FB0F02")] 
[CLSCompliantAttribute(false)] 
[ComVisibleAttribute(true)] 
public interface _PropertyBuilder
[InterfaceTypeAttribute(ComInterfaceType::InterfaceIsIUnknown)] 
[GuidAttribute(L"15F9A479-9397-3A63-ACBD-F51977FB0F02")] 
[CLSCompliantAttribute(false)] 
[ComVisibleAttribute(true)] 
public interface class _PropertyBuilder
/** @attribute InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIUnknown) */ 
/** @attribute GuidAttribute("15F9A479-9397-3A63-ACBD-F51977FB0F02") */
 
/** @attribute CLSCompliantAttribute(false) */ 
/** @attribute ComVisibleAttribute(true) */ 
public interface _PropertyBuilder
InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIUnknown) 
GuidAttribute("15F9A479-9397-3A63-ACBD-F51977FB0F02") 
CLSCompliantAttribute(false) 
ComVisibleAttribute(true) 
public interface _PropertyBuilder
解説解説
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
_PropertyBuilder メンバ
System.Runtime.InteropServices 名前空間

_PropertyBuilder メソッド


_PropertyBuilder メンバ




英和和英テキスト翻訳

英語⇒日本語日本語⇒英語

辞書ショートカット

すべての辞書の索引

「PropertyBuilder」の関連用語

PropertyBuilderのお隣キーワード
検索ランキング

   

英語⇒日本語
日本語⇒英語
   



PropertyBuilderのページの著作権

   
日本マイクロソフト株式会社日本マイクロソフト株式会社
© 2026 Microsoft.All rights reserved.

©2026 GRAS Group, Inc.RSS