CustomTypeDescriptor.GetProperties 方法

定義

傳回這個型別描述項所表示之物件的屬性描述項集合。

多載

GetProperties()

傳回這個型別描述項所表示之物件的屬性描述項集合。

GetProperties(Attribute[])

傳回這個型別描述項所表示之物件的已篩選屬性描述項集合。

備註

方法會 GetProperties 傳回這個類型描述元所表示之物件的屬性描述元集合。 您可以提供選擇性的屬性陣列來篩選傳回的集合。 如果未提供父代,方法會傳回 Empty

GetProperties()

來源:
CustomTypeDescriptor.cs
來源:
CustomTypeDescriptor.cs
來源:
CustomTypeDescriptor.cs

傳回這個型別描述項所表示之物件的屬性描述項集合。

C#
public virtual System.ComponentModel.PropertyDescriptorCollection GetProperties ();

傳回

PropertyDescriptorCollection,包含這個型別描述項所描述之物件的屬性描述項。 預設為 Empty

實作

備註

如果父自定義型別描述元已傳遞至 CustomTypeDescriptor 建構函式,則 GetProperties 方法會呼叫父系的對應方法。

另請參閱

適用於

.NET 9 和其他版本
產品 版本
.NET Core 1.0, Core 1.1, Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9
.NET Framework 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0, 2.1

GetProperties(Attribute[])

來源:
CustomTypeDescriptor.cs
來源:
CustomTypeDescriptor.cs
來源:
CustomTypeDescriptor.cs

傳回這個型別描述項所表示之物件的已篩選屬性描述項集合。

C#
public virtual System.ComponentModel.PropertyDescriptorCollection GetProperties (Attribute[] attributes);
C#
public virtual System.ComponentModel.PropertyDescriptorCollection GetProperties (Attribute[]? attributes);

參數

attributes
Attribute[]

當做篩選條件之型別的陣列。 這可以是 null

傳回

PropertyDescriptorCollection,包含這個型別描述項所描述之物件的屬性描述項。 預設為 Empty

實作

備註

您可以使用 attributes 參數來篩選傳回的集合。 如您選取規則,請參閱 GetProperties

如果父自定義型別描述元已傳遞至 CustomTypeDescriptor 建構函式,則 GetProperties 方法會呼叫父系的對應方法。

另請參閱

適用於

.NET 9 和其他版本
產品 版本
.NET Core 1.0, Core 1.1, Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9
.NET Framework 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0, 2.1