ExpandableObjectConverter.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);
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,具有為這個元件所公開的屬性;如果沒有屬性,則為 null
。
備註
可以使用 context
參數來擷取環境的其他資訊,而這個轉換子就是從這個環境叫用的。 這可能是 null
,所以一定要檢查。 甚至,內容物件上的屬性可能會傳回 null
。
陣列 attributes
將用來篩選陣列。 attributes
可以混 Type 用 和 Attribute 物件。 篩選是由下列規則所定義:
如果屬性沒有 Attribute 相同類別的 ,則屬性將不會包含在傳回的陣列中。
如果屬性是 的 Attribute 實例,則屬性必須是完全相符的,否則不會包含在傳回的陣列中。
Attribute如果指定實例,而且它是預設屬性,即使 屬性中沒有 的實例 Attribute ,它也會包含在傳回的陣列中。