DataFieldConverter.ConvertFrom(ITypeDescriptorContext, CultureInfo, Object) DataFieldConverter.ConvertFrom(ITypeDescriptorContext, CultureInfo, Object) DataFieldConverter.ConvertFrom(ITypeDescriptorContext, CultureInfo, Object) DataFieldConverter.ConvertFrom(ITypeDescriptorContext, CultureInfo, Object) Method

定義

將指定的物件轉換成轉換子的原生型別。Converts the specified object to the native type of the converter.

public:
 override System::Object ^ ConvertFrom(System::ComponentModel::ITypeDescriptorContext ^ context, System::Globalization::CultureInfo ^ culture, System::Object ^ value);
public override object ConvertFrom (System.ComponentModel.ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value);
override this.ConvertFrom : System.ComponentModel.ITypeDescriptorContext * System.Globalization.CultureInfo * obj -> obj
Public Overrides Function ConvertFrom (context As ITypeDescriptorContext, culture As CultureInfo, value As Object) As Object

參數

context
ITypeDescriptorContext ITypeDescriptorContext ITypeDescriptorContext ITypeDescriptorContext

ITypeDescriptorContext 物件,可用來取得額外的內容資訊。An ITypeDescriptorContext object that can be used to gain additional context information.

culture
CultureInfo CultureInfo CultureInfo CultureInfo

CultureInfo,可用來支援當地語系化功能。A CultureInfo that can be used to support localization features.

value
Object Object Object Object

要進行轉換的 ObjectThe Object to convert.

傳回

Object,表示轉換後的指定物件。An Object that represents the specified object after conversion.

例外狀況

無法執行轉換作業。The conversion cannot be performed.

給繼承者的注意事項

覆寫此方法, 以符合您自己的轉換需求。Override this method to meet your own conversion requirements.

context參數可以用來從正在叫用轉換子的環境中, 解壓縮其他相關資訊。The context parameter can be used to extract additional information about the environment the converter is being invoked from. 這可能是null, 因此您應該一律檢查。It might be null, so you should always check. 此外, context物件的屬性null也可能傳回。Also, properties of the context object might also return null.

適用於

另請參閱