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

定义

String 转换为 TimeSpanConverts a String to a TimeSpan.

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

参数

ctx
ITypeDescriptorContext

用于类型转换的 ITypeDescriptorContext 对象。The ITypeDescriptorContext object used for type conversions.

ci
CultureInfo

转换期间使用的 CultureInfo 对象。The CultureInfo object used during conversion.

data
Object

要转换的 String 对象。The String object to convert.

返回

Object

以秒表示 data 参数的 TimeSpanThe TimeSpan representing the data parameter in seconds.

例外

无法将 data 分析为整数值。data cannot be parsed as an integer value.

注解

系统在 ConvertFrom 从配置文件读取时使用方法将 String 值转换为 TimeSpanThe system uses the ConvertFrom method when it reads from a configuration file to convert a String value to TimeSpan.

适用于