ComponentConverter.GetProperties 方法

定義

取得一組由值參數指定的元件類型的屬性。

public:
 override System::ComponentModel::PropertyDescriptorCollection ^ GetProperties(System::ComponentModel::ITypeDescriptorContext ^ context, System::Object ^ value, cli::array <Attribute ^> ^ attributes);
public override System.ComponentModel.PropertyDescriptorCollection GetProperties(System.ComponentModel.ITypeDescriptorContext context, object value, Attribute[] attributes);
override this.GetProperties : System.ComponentModel.ITypeDescriptorContext * obj * Attribute[] -> System.ComponentModel.PropertyDescriptorCollection
Public Overrides Function GetProperties (context As ITypeDescriptorContext, value As Object, attributes As Attribute()) As PropertyDescriptorCollection

參數

context
ITypeDescriptorContext

提供格式背景的一個 ITypeDescriptorContext

value
Object

那是 Object 指定要取得屬性的元件類型。

attributes
Attribute[]

一個將用作過濾器的類型 Attribute 陣列。

傳回

PropertyDescriptorCollection A 是該元件所暴露的屬性,或者null如果沒有屬性。

備註

context 參數可用來擷取關於該轉換器所調用環境的額外資訊。 這可能會是 null,所以一定要檢查。 此外,上下文物件上的屬性也可以回傳 null

attributes陣列將被用來過濾陣列。 它們attributes可以是 和 Attribute 的混合Type。 過濾定義如下規則:

  • 物件 Type 將被視為萬用卡;它會匹配其屬性集合中包含 的 Type 屬性。

  • 若屬性沒有相同類別的 , Attribute 該屬性將不會包含在回傳的陣列中。

  • 若屬性為 的 Attribute實例,該屬性必須完全匹配,否則不會包含在回傳陣列中。

  • 如果指定了一個 Attribute 實例且它是預設屬性,即使該屬性中沒有該實例, Attribute 該實例仍會被包含在回傳的陣列中。

適用於