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

' 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 クラス



英和和英テキスト翻訳>> Weblio翻訳
英語⇒日本語日本語⇒英語
  

辞書ショートカット

すべての辞書の索引

「PropertyDescriptor」の関連用語

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

   

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



PropertyDescriptorのページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

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

©2025 GRAS Group, Inc.RSS