StringConverter.ConvertFrom(ITypeDescriptorContext, CultureInfo, Object) 方法
定义
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,用于提供格式上下文。An ITypeDescriptorContext that provides a format context.
- culture
- CultureInfo
要使用的 CultureInfo。The CultureInfo to use.
返回
一个 Object,它表示转换后的值。An Object that represents the converted value.
例外
转换未能执行。The conversion could not be performed.
注解
context 参数可用于提取有关从中调用该转换器的环境的附加信息。The context parameter can be used to extract additional information about the environment this converter is being invoked from. 这可能是 null ,因此您始终需要检查其值。This can be null, so you always need to check its value. 此外,上下文对象上的属性可以返回 null 。In addition, properties on the context object can return null.