StringArrayConverter.ConvertFrom 方法

定义

将指定的逗号分隔的字符串转换为字符串数组。

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 对象,可用来提取有关调用此转换器的环境的附加信息。 此参数或其属性可以为 null

culture
CultureInfo

CultureInfo 对象。 如果为 null,则使用当前区域性。

value
Object

要转换的 Object

返回

Object

表示转换的 valueObject

例外

由于 value 不是字符串,所以无法执行转换。

注解

ConvertFrom方法将表示以逗号分隔的字符串的对象分析为字符串数组。 在调用此方法之前,您可以调用 CanConvertFrom 方法来确定由指定的对象是否 value 可以转换为字符串数组。

若要将字符串数组转换为逗号分隔的字符串,请使用 ConvertTo 方法。

适用于

另请参阅