TypeConverter.GetStandardValues 方法

定義

傳回資料型別的標準值集合,這個型別轉換子 (Type Converter) 是針對這個資料型別而設計。

多載

GetStandardValues()

從為這個型別轉換子所設計的資料型別預設內容中,會傳回標準值的集合。

GetStandardValues(ITypeDescriptorContext)

提供格式內容時,傳回此類型轉換子所針對資料類型的標準值集合。

GetStandardValues()

從為這個型別轉換子所設計的資料型別預設內容中,會傳回標準值的集合。

public:
 System::Collections::ICollection ^ GetStandardValues();
public System.Collections.ICollection GetStandardValues ();
public System.Collections.ICollection? GetStandardValues ();
member this.GetStandardValues : unit -> System.Collections.ICollection
Public Function GetStandardValues () As ICollection

傳回

TypeConverter.StandardValuesCollection 含有標準有效值的集合,如果資料型別不支援標準值集合,則為 null

備註

在這個類別中實作時,這個方法永遠傳回 null

適用於

GetStandardValues(ITypeDescriptorContext)

提供格式內容時,傳回此類型轉換子所針對資料類型的標準值集合。

public:
 virtual System::ComponentModel::TypeConverter::StandardValuesCollection ^ GetStandardValues(System::ComponentModel::ITypeDescriptorContext ^ context);
public virtual System.ComponentModel.TypeConverter.StandardValuesCollection GetStandardValues (System.ComponentModel.ITypeDescriptorContext context);
public virtual System.ComponentModel.TypeConverter.StandardValuesCollection? GetStandardValues (System.ComponentModel.ITypeDescriptorContext? context);
abstract member GetStandardValues : System.ComponentModel.ITypeDescriptorContext -> System.ComponentModel.TypeConverter.StandardValuesCollection
override this.GetStandardValues : System.ComponentModel.ITypeDescriptorContext -> System.ComponentModel.TypeConverter.StandardValuesCollection
Public Overridable Function GetStandardValues (context As ITypeDescriptorContext) As TypeConverter.StandardValuesCollection

參數

context
ITypeDescriptorContext

提供格式內容的 ITypeDescriptorContext,可用來擷取環境的其他資訊,而這個轉換子就是從此環境叫用。 這個參數或這個參數的屬性可為 null

傳回

保留標準有效值集合的 TypeConverter.StandardValuesCollection,或者如果資料類型不支援標準值集合,則為 null

範例

如需此函式的範例,請參閱 TypeConverter 類別。

備註

如同 在 中實作 TypeConverter ,這個方法一律會傳 null 回 。

給繼承者的注意事項

如果您想要轉換的類型支援標準值,請覆寫這個方法。

另請參閱

適用於