InfiniteTimeSpanConverter.ConvertFrom Method (ITypeDescriptorContext, CultureInfo, Object)


Converts a String to a TimeSpan.

Namespace:   System.Configuration
Assembly:  System.Configuration (in System.Configuration.dll)

public override object ConvertFrom(
	ITypeDescriptorContext ctx,
	CultureInfo ci,
	object data


Type: System.ComponentModel.ITypeDescriptorContext

The ITypeDescriptorContext object used for type conversions.

Type: System.Globalization.CultureInfo

The CultureInfo object used during conversion.

Type: System.Object

The String object to convert.

Return Value

Type: System.Object

The MaxValue, if the data parameter is the String infinite; otherwise, the TimeSpan representing the data parameter in minutes.

The system uses the ConvertFrom method when reading from a configuration file to convert a String value to TimeSpan or the String "infinite" to MaxValue.

.NET Framework
Available since 2.0
Return to top