语言

InfiniteTimeSpanConverter.ConvertFrom 方法

定义

将 String 转换为 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用于类型转换的对象。

ci
CultureInfo

CultureInfo转换期间使用的对象。

data
Object

要 String 转换的对象。

返回

如果参数是data无限的,String;否则,表示TimeSpandata参数以分钟为单位。

注解

从配置文件中读取值以将值转换为或ConvertFrom“无限”转换为StringTimeSpan时,系统会使用StringMaxValue该方法。

适用于