PropertyDescriptor クラス
アセンブリ: System (system.dll 内)


プロパティの説明は、プロパティの名前、属性、そのプロパティが関連付けられているコンポーネント クラス、およびプロパティの型で構成されています。
PropertyDescriptor は、次のプロパティとメソッドを提供します。
また、PropertyDescriptor は、次の abstract のプロパティとメソッドを提供します。
-
ComponentType は、プロパティが関連付けられているコンポーネントの型を格納します。
通常、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.ComponentModel.MemberDescriptor
System.ComponentModel.PropertyDescriptor
System.ComponentModel.TypeConverter.SimplePropertyDescriptor


Windows 98, Windows 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


PropertyDescriptor コンストラクタ (String, Attribute[])
アセンブリ: System (system.dll 内)

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

Windows 98, Windows 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


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 コンストラクタ (MemberDescriptor, Attribute[])
アセンブリ: System (system.dll 内)

Dim descr As MemberDescriptor Dim attrs As Attribute() Dim instance As New PropertyDescriptor(descr, attrs)


Windows 98, Windows 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


PropertyDescriptor コンストラクタ (MemberDescriptor)
アセンブリ: System (system.dll 内)


Windows 98, Windows 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


PropertyDescriptor プロパティ

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

名前 | 説明 | |
---|---|---|
![]() | AttributeArray | 属性の配列を取得または設定します。 ( MemberDescriptor から継承されます。) |
![]() | NameHashCode | GetHashCode で指定されている、メンバの名前のハッシュ コードを取得します。 ( MemberDescriptor から継承されます。) |

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 メンバ
PropertyDescriptor データ型で公開されるメンバを以下の表に示します。


名前 | 説明 | |
---|---|---|
![]() | Attributes | メンバの属性のコレクションを取得します。(MemberDescriptor から継承されます。) |
![]() | Category | CategoryAttribute で指定されている、メンバが属するカテゴリの名前を取得します。(MemberDescriptor から継承されます。) |
![]() ![]() | 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のページへのリンク