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

PropertyDescriptor クラス

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

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

<ComVisibleAttribute(True)> _
Public MustInherit Class
 PropertyDescriptor
    Inherits MemberDescriptor
[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) メンバはすべて、スレッド セーフです。インスタンス メンバ場合は、スレッド セーフであるとは限りません。
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照



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

辞書ショートカット

すべての辞書の索引

「PropertyDescriptor クラス」の関連用語

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

   

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



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

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

©2025 GRAS Group, Inc.RSS