ComponentConverter.GetProperties 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
取得一組由值參數指定的元件類型的屬性。
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 。
傳回
PropertyDescriptorCollection A 是該元件所暴露的屬性,或者null如果沒有屬性。
備註
該 context 參數可用來擷取關於該轉換器所調用環境的額外資訊。 這可能會是 null,所以一定要檢查。 此外,上下文物件上的屬性也可以回傳 null。
attributes陣列將被用來過濾陣列。 它們attributes可以是 和 Attribute 的混合Type。 過濾定義如下規則:
若屬性沒有相同類別的 , Attribute 該屬性將不會包含在回傳的陣列中。
若屬性為 的 Attribute實例,該屬性必須完全匹配,否則不會包含在回傳陣列中。
如果指定了一個 Attribute 實例且它是預設屬性,即使該屬性中沒有該實例, Attribute 該實例仍會被包含在回傳的陣列中。