Rediger

Del via


TimeSpanSecondsOrInfiniteConverter.ConvertTo Method

Definition

Converts a TimeSpan to a. String.

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

Parameters

ctx
ITypeDescriptorContext

The ITypeDescriptorContext object used for type conversions.

ci
CultureInfo

The CultureInfo object used during conversion.

value
Object

The value to convert.

type
Type

The conversion type.

Returns

The String "infinite", if the value parameter is TimeSpan.MaxValue; otherwise, the String representing the value parameter in seconds.

Examples

Refer to the code examples in the InfiniteTimeSpanConverter and TimeSpanMinutesConverter classes.

Remarks

The system uses ConvertTo when writing to a configuration file to convert a TimeSpan value or MaxValue to a String.

Applies to