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

PropertyDescriptor クラス

クラスのプロパティの抽象化を提供します。

名前空間: System.ComponentModel
アセンブリ: System (system.dll 内)
構文構文

<ComVisibleAttribute(True)> _
Public MustInherit Class
 PropertyDescriptor
    Inherits MemberDescriptor
Dim instance As PropertyDescriptor
[ComVisibleAttribute(true)] 
public abstract class PropertyDescriptor :
 MemberDescriptor
[ComVisibleAttribute(true)] 
public ref class PropertyDescriptor abstract
 : public MemberDescriptor
/** @attribute ComVisibleAttribute(true) */ 
public abstract class PropertyDescriptor extends
 MemberDescriptor
ComVisibleAttribute(true) 
public abstract class PropertyDescriptor extends
 MemberDescriptor
解説解説

プロパティの説明は、プロパティの名前、属性、そのプロパティが関連付けられているコンポーネント クラス、およびプロパティの型で構成されています。

PropertyDescriptor は、次のプロパティとメソッドを提供します。

また、PropertyDescriptor は、次の abstract のプロパティとメソッドを提供します。

通常、abstract メンバはリフレクションによって実装されます。リフレクションの詳細については、リフレクション のトピックを参照してください。

メモメモ

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

使用例使用例

PropertyDescriptorCollection クラスの例に基づいて構築されているコード例を次に示します。テキスト ボックス内のボタンのテキストに関する情報 (カテゴリ、説明、表示名) を出力します。この例は、button1 と textbox1 がフォーム上でインスタンス化されていることを前提としています。

' Creates a new collection and assign it the properties for button1.
Dim properties As PropertyDescriptorCollection
 = TypeDescriptor.GetProperties(Button1)

' Sets an PropertyDescriptor to the specific property.
Dim myProperty As PropertyDescriptor = properties.Find("Text",
 False)

' Prints the property and the property description.
TextBox1.Text += myProperty.DisplayName & Microsoft.VisualBasic.ControlChars.Cr
TextBox1.Text += myProperty.Description & Microsoft.VisualBasic.ControlChars.Cr
TextBox1.Text += myProperty.Category & Microsoft.VisualBasic.ControlChars.Cr
// Creates a new collection and assign it the properties for button1.
PropertyDescriptorCollection properties = TypeDescriptor.GetProperties(button1);

// Sets an PropertyDescriptor to the specific property.
System.ComponentModel.PropertyDescriptor myProperty = properties.Find("Text",
 false);

// Prints the property and the property description.
textBox1.Text = myProperty.DisplayName+ '\n' ;
textBox1.Text += myProperty.Description + '\n';
textBox1.Text += myProperty.Category + '\n';
// Creates a new collection and assign it the properties for button1.
PropertyDescriptorCollection^ properties = TypeDescriptor::GetProperties( button1
 );

// Sets an PropertyDescriptor to the specific property.
System::ComponentModel::PropertyDescriptor^ myProperty = properties->Find( "Text",
 false );

// Prints the property and the property description.
textBox1->Text = String::Concat( myProperty->DisplayName, "\n" );
textBox1->Text = String::Concat( textBox1->Text, myProperty->Description,
 "\n" );
textBox1->Text = String::Concat( textBox1->Text, myProperty->Category, "\n"
 );
// Creates a new collection and assign it the properties for button1.
PropertyDescriptorCollection properties = 
    TypeDescriptor.GetProperties(button1);
// Sets an PropertyDescriptor to the specific property.
System.ComponentModel.PropertyDescriptor myProperty = 
    properties.Find("Text", false);
// Prints the property and the property description.
textBox1.set_Text(myProperty.get_DisplayName() + 'n');
textBox1.set_Text(textBox1.get_Text() + myProperty.get_Description() 
    + '\n');
textBox1.set_Text(textBox1.get_Text() + myProperty.get_Category()
    + '\n');
継承階層継承階層
System.Object
   System.ComponentModel.MemberDescriptor
    System.ComponentModel.PropertyDescriptor
       System.ComponentModel.TypeConverter.SimplePropertyDescriptor
スレッド セーフスレッド セーフ
この型の public static (Visual Basic では Shared) メンバはすべて、スレッド セーフです。インスタンス メンバの場合は、スレッド セーフであるとは限りません。
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
PropertyDescriptor メンバ
System.ComponentModel 名前空間
MemberDescriptor クラス
Attribute
DefaultValueAttribute クラス

PropertyDescriptor コンストラクタ (String, Attribute[])

名前と属性を指定して、PropertyDescriptor クラスの新しいインスタンスを初期化します。

名前空間: System.ComponentModel
アセンブリ: System (system.dll 内)
構文構文

Dim name As String
Dim attrs As Attribute()

Dim instance As New PropertyDescriptor(name,
 attrs)
protected PropertyDescriptor (
    string name,
    Attribute[] attrs
)
protected:
PropertyDescriptor (
    String^ name, 
    array<Attribute^>^ attrs
)
protected PropertyDescriptor (
    String name, 
    Attribute[] attrs
)
protected function PropertyDescriptor (
    name : String, 
    attrs : Attribute[]
)

パラメータ

name

プロパティの名前。

attrs

プロパティの属性を格納している Attribute 型の配列。

プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照

PropertyDescriptor コンストラクタ

PropertyDescriptor クラスの新しいインスタンスを初期化します。
オーバーロードの一覧オーバーロードの一覧

名前 説明
PropertyDescriptor (MemberDescriptor) 指定した MemberDescriptor 内の名前と属性を使用して、PropertyDescriptor クラスの新しいインスタンスを初期化します。

.NET Compact Framework によってサポートされています。

PropertyDescriptor (MemberDescriptor, Attribute[]) 指定した MemberDescriptor 内の名前と、MemberDescriptor および Attribute 配列の両方に格納されている属性を使用して、PropertyDescriptor クラスの新しいインスタンスを初期化します。

.NET Compact Framework によってサポートされています。

PropertyDescriptor (String, Attribute[]) 名前と属性を指定して、PropertyDescriptor クラスの新しいインスタンスを初期化します。

.NET Compact Framework によってサポートされています。

参照参照

関連項目

PropertyDescriptor クラス
PropertyDescriptor メンバ
System.ComponentModel 名前空間
MemberDescriptor クラス

PropertyDescriptor コンストラクタ (MemberDescriptor, Attribute[])

指定した MemberDescriptor 内の名前と、MemberDescriptor および Attribute 配列の両方に格納されている属性を使用して、PropertyDescriptor クラスの新しいインスタンスを初期化します。

名前空間: System.ComponentModel
アセンブリ: System (system.dll 内)
構文構文

Protected Sub New ( _
    descr As MemberDescriptor, _
    attrs As Attribute() _
)
Dim descr As MemberDescriptor
Dim attrs As Attribute()

Dim instance As New PropertyDescriptor(descr,
 attrs)
protected PropertyDescriptor (
    MemberDescriptor descr,
    Attribute[] attrs
)
protected:
PropertyDescriptor (
    MemberDescriptor^ descr, 
    array<Attribute^>^ attrs
)
protected PropertyDescriptor (
    MemberDescriptor descr, 
    Attribute[] attrs
)
protected function PropertyDescriptor (
    descr : MemberDescriptor, 
    attrs : Attribute[]
)

パラメータ

descr

メンバの名前とその属性を格納している MemberDescriptor。

attrs

プロパティに関連付ける属性を格納している Attribute 配列。

解説解説
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
PropertyDescriptor クラス
PropertyDescriptor メンバ
System.ComponentModel 名前空間
MemberDescriptor クラス
Attribute

PropertyDescriptor コンストラクタ (MemberDescriptor)

指定した MemberDescriptor 内の名前と属性を使用して、PropertyDescriptor クラスの新しいインスタンスを初期化します。

名前空間: System.ComponentModel
アセンブリ: System (system.dll 内)
構文構文

Protected Sub New ( _
    descr As MemberDescriptor _
)
Dim descr As MemberDescriptor

Dim instance As New PropertyDescriptor(descr)
protected PropertyDescriptor (
    MemberDescriptor descr
)
protected:
PropertyDescriptor (
    MemberDescriptor^ descr
)
protected PropertyDescriptor (
    MemberDescriptor descr
)
protected function PropertyDescriptor (
    descr : MemberDescriptor
)

パラメータ

descr

プロパティの名前と属性を格納している MemberDescriptor。

プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
PropertyDescriptor クラス
PropertyDescriptor メンバ
System.ComponentModel 名前空間
MemberDescriptor クラス

PropertyDescriptor プロパティ


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

( プロテクト プロパティ も参照)
  名前 説明
パブリック プロパティ Attributes  メンバの属性のコレクションを取得します。 ( MemberDescriptor から継承されます。)
パブリック プロパティ Category  CategoryAttribute で指定されている、メンバが属するカテゴリの名前を取得します。 ( MemberDescriptor から継承されます。)
パブリック プロパティ .NET Compact Framework によるサポート Converter プロパティの型コンバータを取得します。
パブリック プロパティ Description  DescriptionAttribute で指定されている、メンバの説明を取得します。 ( MemberDescriptor から継承されます。)
パブリック プロパティ DesignTimeOnly  DesignOnlyAttribute で指定されている、メンバを設定できるのがデザイン時だけかどうかを示す値を取得します。 ( MemberDescriptor から継承されます。)
パブリック プロパティ DisplayName  [プロパティ] ウィンドウなどのウィンドウに表示できる名前を取得します。 ( MemberDescriptor から継承されます。)
パブリック プロパティ IsBrowsable  BrowsableAttribute で指定されている、メンバが参照可能かどうかを示す値を取得します。 ( MemberDescriptor から継承されます。)
パブリック プロパティ Name  メンバの名前を取得します。 ( MemberDescriptor から継承されます。)
パブリック プロパティ SupportsChangeEvents このプロパティの値変更通知をプロパティ記述子以外から発生させてよいかどうかを示す値を取得します。
プロテクト プロパティプロテクト プロパティ
  名前 説明
プロテクト プロパティ AttributeArray  属性の配列を取得または設定します。 ( MemberDescriptor から継承されます。)
プロテクト プロパティ NameHashCode  GetHashCode で指定されている、メンバの名前のハッシュ コードを取得します。 ( MemberDescriptor から継承されます。)
参照参照

関連項目

PropertyDescriptor クラス
System.ComponentModel 名前空間
MemberDescriptor クラス
Attribute
DefaultValueAttribute クラス

PropertyDescriptor メソッド


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

( プロテクト メソッド も参照)
  名前 説明
パブリック メソッド AddValueChanged プロパティが変更されたときに、ほかのオブジェクトに通知できるようにします。
パブリック メソッド CanResetValue 派生クラスでオーバーライドされた場合、オブジェクトをリセットしたときに、そのオブジェクトの値が変化するかどうかを示す値を返します。
パブリック メソッド Equals オーバーロードされます。 オーバーライドされます。 プロパティ記述子を別のオブジェクトと比較して、等しいかどうかを確認します。
パブリック メソッド GetChildProperties オーバーロードされます。 PropertyDescriptorCollection を返します。
パブリック メソッド GetEditor 指定した型のエディタを取得します。
パブリック メソッド GetHashCode オーバーライドされます。 このオブジェクトのハッシュ コードを返します。
パブリック メソッド GetType  現在のインスタンスの Type を取得します。 ( Object から継承されます。)
パブリック メソッド GetValue 派生クラスでオーバーライドされた場合、コンポーネントのプロパティの現在の値を取得します。
パブリック メソッド ReferenceEquals  指定した複数の Object インスタンスが同一かどうかを判断します。 ( Object から継承されます。)
パブリック メソッド RemoveValueChanged プロパティが変更されたときに、ほかのオブジェクトに通知できるようにします。
パブリック メソッド ResetValue 派生クラスでオーバーライドされた場合、コンポーネントのプロパティの値を既定値にリセットします。
パブリック メソッド SetValue 派生クラスでオーバーライドされた場合、コンポーネントの値を別の値に設定します。
パブリック メソッド ShouldSerializeValue 派生クラスでオーバーライドされた場合、プロパティの値を永続化する必要があるかどうかを示す値を決定します。
パブリック メソッド ToString  現在の Object を表す String を返します。 ( Object から継承されます。)
プロテクト メソッドプロテクト メソッド
  名前 説明
プロテクト メソッド CreateAttributeCollection  コンストラクタに渡された属性配列を使用して、属性のコレクションを作成します。 ( MemberDescriptor から継承されます。)
プロテクト メソッド CreateInstance 指定した型のインスタンスを作成します。
プロテクト メソッド FillAttributes オーバーライドされます。 指定した親クラスの属性リストに PropertyDescriptor の属性を追加します。
プロテクト メソッド Finalize  Object がガベージ コレクションにより収集される前に、その Object がリソースを解放し、その他のクリーンアップ操作を実行できるようにします。 ( Object から継承されます。)
プロテクト メソッド FindMethod  オーバーロードされます。 指定したメソッドをリフレクションによって検索します。 ( MemberDescriptor から継承されます。)
プロテクト メソッド GetInvocationTarget オーバーライドされます。 このメソッドでは、メンバの呼び出し中に使用するオブジェクトが返されます。
プロテクト メソッド GetInvokee  メソッドを呼び出す対象のコンポーネントを取得します。 ( MemberDescriptor から継承されます。)
プロテクト メソッド GetSite  指定したコンポーネントのコンポーネント サイトを取得します。 ( MemberDescriptor から継承されます。)
プロテクト メソッド GetTypeFromName 型名を使用して型を返します。
プロテクト メソッド GetValueChangedHandler 特定のコンポーネントについて現在の ValueChanged イベント ハンドラ セットを取得します。
プロテクト メソッド MemberwiseClone  現在の Object の簡易コピーを作成します。 ( Object から継承されます。)
プロテクト メソッド OnValueChanged 実装した ValueChanged イベントを発生させます。
参照参照

関連項目

PropertyDescriptor クラス
System.ComponentModel 名前空間
MemberDescriptor クラス
Attribute
DefaultValueAttribute クラス

PropertyDescriptor メンバ

クラスのプロパティの抽象化を提供します。

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


プロテクト コンストラクタプロテクト コンストラクタ
  名前 説明
プロテクト メソッド PropertyDescriptor オーバーロードされます。 PropertyDescriptor クラスの新しいインスタンスを初期化します。
パブリック プロパティパブリック プロパティ
( プロテクト プロパティ も参照)
  名前 説明
パブリック プロパティ Attributes  メンバの属性のコレクションを取得します。(MemberDescriptor から継承されます。)
パブリック プロパティ Category  CategoryAttribute で指定されている、メンバが属するカテゴリの名前を取得します。(MemberDescriptor から継承されます。)
パブリック プロパティ .NET Compact Framework によるサポート Converter プロパティの型コンバータを取得します。
パブリック プロパティ Description  DescriptionAttribute で指定されている、メンバの説明を取得します。(MemberDescriptor から継承されます。)
パブリック プロパティ DesignTimeOnly  DesignOnlyAttribute で指定されている、メンバを設定できるのがデザイン時だけかどうかを示す値を取得します。(MemberDescriptor から継承されます。)
パブリック プロパティ DisplayName  [プロパティ] ウィンドウなどのウィンドウに表示できる名前を取得します。(MemberDescriptor から継承されます。)
パブリック プロパティ IsBrowsable  BrowsableAttribute で指定されている、メンバが参照可能かどうかを示す値を取得します。(MemberDescriptor から継承されます。)
パブリック プロパティ Name  メンバの名前を取得します。(MemberDescriptor から継承されます。)
パブリック プロパティ SupportsChangeEvents このプロパティの値変更通知をプロパティ記述子以外から発生させてよいかどうかを示す値を取得します。
プロテクト プロパティプロテクト プロパティ
  名前 説明
プロテクト プロパティ AttributeArray  属性の配列を取得または設定します。(MemberDescriptor から継承されます。)
プロテクト プロパティ NameHashCode  GetHashCode で指定されている、メンバの名前のハッシュ コードを取得します。(MemberDescriptor から継承されます。)
パブリック メソッドパブリック メソッド
( プロテクト メソッド も参照)
  名前 説明
パブリック メソッド AddValueChanged プロパティが変更されたときに、ほかのオブジェクトに通知できるようにします。
パブリック メソッド CanResetValue 派生クラスでオーバーライドされた場合、オブジェクトをリセットしたときに、そのオブジェクトの値が変化するかどうかを示す値を返します。
パブリック メソッド Equals オーバーロードされます。 オーバーライドされます。 プロパティ記述子を別のオブジェクトと比較して、等しいかどうかを確認します。
パブリック メソッド GetChildProperties オーバーロードされます。 PropertyDescriptorCollection を返します。
パブリック メソッド GetEditor 指定した型のエディタを取得します。
パブリック メソッド GetHashCode オーバーライドされます。 このオブジェクトのハッシュ コードを返します。
パブリック メソッド GetType  現在のインスタンスの Type を取得します。 (Object から継承されます。)
パブリック メソッド GetValue 派生クラスでオーバーライドされた場合、コンポーネントのプロパティの現在の値を取得します。
パブリック メソッド ReferenceEquals  指定した複数の Object インスタンスが同一かどうかを判断します。 (Object から継承されます。)
パブリック メソッド RemoveValueChanged プロパティが変更されたときに、ほかのオブジェクトに通知できるようにします。
パブリック メソッド ResetValue 派生クラスでオーバーライドされた場合、コンポーネントのプロパティの値を既定値にリセットします。
パブリック メソッド SetValue 派生クラスでオーバーライドされた場合、コンポーネントの値を別の値に設定します。
パブリック メソッド ShouldSerializeValue 派生クラスでオーバーライドされた場合、プロパティの値を永続化する必要があるかどうかを示す値を決定します。
パブリック メソッド ToString  現在の Object を表す String を返します。 (Object から継承されます。)
プロテクト メソッドプロテクト メソッド
  名前 説明
プロテクト メソッド CreateAttributeCollection  コンストラクタに渡された属性配列を使用して、属性のコレクションを作成します。 (MemberDescriptor から継承されます。)
プロテクト メソッド CreateInstance 指定した型のインスタンスを作成します。
プロテクト メソッド FillAttributes オーバーライドされます。 指定した親クラスの属性リストに PropertyDescriptor の属性を追加します。
プロテクト メソッド Finalize  Object がガベージ コレクションにより収集される前に、その Object がリソースを解放し、その他のクリーンアップ操作を実行できるようにします。 (Object から継承されます。)
プロテクト メソッド FindMethod  オーバーロードされます。 指定したメソッドをリフレクションによって検索します。 (MemberDescriptor から継承されます。)
プロテクト メソッド GetInvocationTarget オーバーライドされます。 このメソッドでは、メンバの呼び出し中に使用するオブジェクトが返されます。
プロテクト メソッド GetInvokee  メソッドを呼び出す対象のコンポーネントを取得します。 (MemberDescriptor から継承されます。)
プロテクト メソッド GetSite  指定したコンポーネントのコンポーネント サイトを取得します。 (MemberDescriptor から継承されます。)
プロテクト メソッド GetTypeFromName 型名を使用して型を返します。
プロテクト メソッド GetValueChangedHandler 特定のコンポーネントについて現在の ValueChanged イベント ハンドラ セットを取得します。
プロテクト メソッド MemberwiseClone  現在の Object の簡易コピーを作成します。 (Object から継承されます。)
プロテクト メソッド OnValueChanged 実装した ValueChanged イベントを発生させます。
参照参照

関連項目

PropertyDescriptor クラス
System.ComponentModel 名前空間
MemberDescriptor クラス
Attribute
DefaultValueAttribute クラス



英和和英テキスト翻訳

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

辞書ショートカット

すべての辞書の索引

「PropertyDescriptor」の関連用語

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

   

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



PropertyDescriptorのページの著作権

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

©2026 GRAS Group, Inc.RSS