DataSourceConverter.ConvertFrom(ITypeDescriptorContext, CultureInfo, Object) 方法

定义

将指定对象转换为转换器的本机类型。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

可用于获取附加上下文信息的 ITypeDescriptorContextAn ITypeDescriptorContext that can be used to gain additional context information.

culture
CultureInfo

可用于支持本地化功能的 CultureInfoThe CultureInfo that can be used to support localization features.

value
Object

要转换的 ObjectThe Object to convert.

返回

Object

表示转换后的指定对象的 ObjectAn Object that represents the specified object after conversion.

例外

转换未能执行。The conversion could not 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. 此外,上下文对象的属性还可能返回 nullAlso, properties of the context object may also return null.

适用于

另请参阅