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則 TimeSpan.MaxValue,否則為以TimeSpan分鐘為單位表示參數的 data

備註

從組態檔讀取 時,ConvertFrom系統會使用 方法,將值TimeSpan轉換成 或String將 “infinite” 轉換為 StringMaxValue

適用於