TimeSpanSecondsConverter.ConvertFrom(ITypeDescriptorContext, CultureInfo, Object) 方法
定义
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
参数
用于类型转换的 ITypeDescriptorContext 对象。The ITypeDescriptorContext object used for type conversions.
- ci
- CultureInfo
转换期间使用的 CultureInfo 对象。The CultureInfo object used during conversion.
返回
以秒表示 data 参数的 TimeSpan。The TimeSpan representing the data parameter in seconds.
例外
无法将 data 分析为整数值。data cannot be parsed as an integer value.
注解
系统在 ConvertFrom 从配置文件读取时使用方法将 String 值转换为 TimeSpan 。The system uses the ConvertFrom method when it reads from a configuration file to convert a String value to TimeSpan.