指定した属性配列をフィルタとして使用して、指定したコンポーネントのプロパティのコレクションを取得します。
Overloads Public Shared Function GetProperties( _
ByVal component As Object, _ ByVal attributes() As Attribute _) As PropertyDescriptorCollection
[C#]
public static PropertyDescriptorCollection GetProperties(objectcomponent,Attribute[] attributes);
[C++]
public: static PropertyDescriptorCollection* GetProperties(Object* component,Attribute* attributes[]);
[JScript]
public static function GetProperties(
component : Object,attributes : Attribute[]) : PropertyDescriptorCollection;
パラメータ
- component
プロパティを取得する対象のコンポーネント。 - attributes
フィルタとして使用される、 Attribute 型の配列。
戻り値
指定したコンポーネントのプロパティのうち、指定した属性に一致するプロパティを格納している PropertyDescriptorCollection 。
例外
例外の種類 | 条件 |
---|---|
ArgumentNullException | component パラメータが null 参照 (Visual Basic では Nothing) です。 |
解説
component パラメータで指定されたコンポーネントが配置された場合、その場所に応じてプロパティが追加または削除されるため、component パラメータのコンポーネントのプロパティは、クラスのプロパティとは異なる場合があります。
attributes パラメータの配列は、配列をフィルタ処理するために使用されます。attributes パラメータには、 Type オブジェクトと Attribute オブジェクトを組み合わせて指定できます。フィルタ処理は、次の規則で定義されます。
- Type オブジェクトはワイルドカードとして扱われます。このオブジェクトは、属性の 1 つとして Type を持つすべてのプロパティと一致します。
- プロパティが同じクラスの Attribute を持たない場合、返される配列にそのプロパティは含まれません。
- 属性が Attribute のインスタンスである場合、プロパティは厳密に一致している必要があります。厳密に一致しない場合、返される配列にそのプロパティは含まれません。
- Attribute インスタンスが指定され、このインスタンスが既定のプロパティである場合、プロパティが Attribute のインスタンスを持っていない場合でも、このインスタンスは返される配列に含まれます。
必要条件
プラットフォーム: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 ファミリ
参照
TypeDescriptor クラス | TypeDescriptor メンバ | System.ComponentModel 名前空間 | TypeDescriptor.GetProperties オーバーロードの一覧 | TypeDescriptor | EventDescriptor | PropertyDescriptor | PropertyDescriptorCollection | Attribute