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

定义

将指定的值对象转换为 String 对象。Converts the specified value object to a String 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

要使用的 CultureInfoThe CultureInfo to use.

value
Object

要转换的 ObjectThe Object to convert.

返回

一个 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. 此外,上下文对象上的属性可能返回 nullIn addition, properties on the context object can return null.

适用于

另请参阅