語言

TypeConverter.GetProperties 方法

定義

回傳一組由值參數指定的陣列類型屬性。

多載

名稱 Description
GetProperties(Object)

回傳一組由值參數指定的陣列類型屬性。

GetProperties(ITypeDescriptorContext, Object)

回傳一組由值參數指定的陣列類型屬性,並依照指定的上下文。

GetProperties(ITypeDescriptorContext, Object, Attribute[])

回傳一組由值參數指定的陣列類型屬性,使用指定的上下文與屬性。

GetProperties(Object)

來源:
TypeConverter.cs
來源:
TypeConverter.cs
來源:
TypeConverter.cs
來源:
TypeConverter.cs
來源:
TypeConverter.cs

回傳一組由值參數指定的陣列類型屬性。

public:
 System::ComponentModel::PropertyDescriptorCollection ^ GetProperties(System::Object ^ value);
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("The Type of value cannot be statically discovered.")]
public System.ComponentModel.PropertyDescriptorCollection? GetProperties(object value);
public System.ComponentModel.PropertyDescriptorCollection GetProperties(object value);
[<System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("The Type of value cannot be statically discovered.")>]
member this.GetProperties : obj -> System.ComponentModel.PropertyDescriptorCollection
member this.GetProperties : obj -> System.ComponentModel.PropertyDescriptorCollection
Public Function GetProperties (value As Object) As PropertyDescriptorCollection

參數

value
Object

一個 Object 指定要取得屬性的陣列類型。

傳回

PropertyDescriptorCollection A,包含該資料型別暴露的屬性,或null是沒有屬性。

屬性

備註

在此類別中實作時,此方法總是回傳 null。

預設情況下,型別不會回傳屬性。 此方法的簡單實作可要求 GetProperties 正確的資料型別。

適用於

GetProperties(ITypeDescriptorContext, Object)

來源:
TypeConverter.cs
來源:
TypeConverter.cs
來源:
TypeConverter.cs
來源:
TypeConverter.cs
來源:
TypeConverter.cs

回傳一組由值參數指定的陣列類型屬性,並依照指定的上下文。

public:
 System::ComponentModel::PropertyDescriptorCollection ^ GetProperties(System::ComponentModel::ITypeDescriptorContext ^ context, System::Object ^ value);
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("The Type of value cannot be statically discovered.")]
public System.ComponentModel.PropertyDescriptorCollection? GetProperties(System.ComponentModel.ITypeDescriptorContext? context, object value);
public System.ComponentModel.PropertyDescriptorCollection GetProperties(System.ComponentModel.ITypeDescriptorContext context, object value);
[<System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("The Type of value cannot be statically discovered.")>]
member this.GetProperties : System.ComponentModel.ITypeDescriptorContext * obj -> System.ComponentModel.PropertyDescriptorCollection
member this.GetProperties : System.ComponentModel.ITypeDescriptorContext * obj -> System.ComponentModel.PropertyDescriptorCollection
Public Function GetProperties (context As ITypeDescriptorContext, value As Object) As PropertyDescriptorCollection

參數

context
ITypeDescriptorContext

提供格式背景的一個 ITypeDescriptorContext 。

value
Object

一個 Object 指定要取得屬性的陣列類型。

傳回

PropertyDescriptorCollection A,包含該資料型別暴露的屬性,或null是沒有屬性。

屬性

備註

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

在此類別中實作時,此方法總是回傳 null。

預設情況下,型別不會回傳屬性。 此方法的簡單實作可要求 GetProperties 正確的資料型別。

另請參閱

適用於

GetProperties(ITypeDescriptorContext, Object, Attribute[])

來源:
TypeConverter.cs
來源:
TypeConverter.cs
來源:
TypeConverter.cs
來源:
TypeConverter.cs
來源:
TypeConverter.cs

回傳一組由值參數指定的陣列類型屬性,使用指定的上下文與屬性。

public:
 virtual System::ComponentModel::PropertyDescriptorCollection ^ GetProperties(System::ComponentModel::ITypeDescriptorContext ^ context, System::Object ^ value, cli::array <Attribute ^> ^ attributes);
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("The Type of value cannot be statically discovered. The public parameterless constructor or the 'Default' static field may be trimmed from the Attribute's Type.")]
public virtual System.ComponentModel.PropertyDescriptorCollection? GetProperties(System.ComponentModel.ITypeDescriptorContext? context, object value, Attribute[]? attributes);
public virtual System.ComponentModel.PropertyDescriptorCollection GetProperties(System.ComponentModel.ITypeDescriptorContext context, object value, Attribute[] attributes);
[<System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("The Type of value cannot be statically discovered. The public parameterless constructor or the 'Default' static field may be trimmed from the Attribute's Type.")>]
abstract member GetProperties : System.ComponentModel.ITypeDescriptorContext * obj * Attribute[] -> System.ComponentModel.PropertyDescriptorCollection
override this.GetProperties : System.ComponentModel.ITypeDescriptorContext * obj * Attribute[] -> System.ComponentModel.PropertyDescriptorCollection
abstract member GetProperties : System.ComponentModel.ITypeDescriptorContext * obj * Attribute[] -> System.ComponentModel.PropertyDescriptorCollection
override this.GetProperties : System.ComponentModel.ITypeDescriptorContext * obj * Attribute[] -> System.ComponentModel.PropertyDescriptorCollection
Public Overridable 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是沒有屬性。

屬性

備註

在此類別中實作時,此方法總是回傳 null。

給繼承者的注意事項

如果你想轉換的類型支援屬性,則可以覆寫這個方法。

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

屬性陣列用於過濾陣列。 屬性可以是 和 TypeAttribute 物件的混合。 過濾定義如下規則:

  • A Type 被視為萬用卡;它匹配於屬性集合中具有 的 Type 屬性。

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

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

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

另請參閱

適用於