Assembly: System.Configuration (in system.configuration.dll)
This type, like all the other configuration converter types, converts strings found in the configuration file to and from the related strongly typed properties.
In particular the InfiniteTimeSpanConverter converts the String value "infinite" assigned to a configuration property to the standard infinite TimeSpan and vice versa. The infinite TimeSpan value is represented by the MaxValue enumeration value.
This converter is used with TimeSpan properties. An infinite value is persisted as the "infinite" string.
The following code example shows how to define a custom section property that uses the InfiniteTimeSpanConverter class.
For the complete example code that implements the custom section, refer to the ConfigurationConverterBase class.
The following example code shows how to access the previous custom section property.
The following is a configuration excerpt as used by the previous example.
<?xml version="1.0" encoding="utf-8"?> <configuration> <configSections> <section name="CustomSection" type="Samples.AspNet.CustomSection, ConfigurationConverters, Version=220.127.116.11, Culture=neutral, PublicKeyToken=null" allowDefinition="Everywhere" allowExeDefinition="MachineToApplication" restartOnExternalChanges="true" /> </configSections> <CustomSection fileName="default.txt" maxIdleTime="90" timeDelay="infinite"/> </configuration>
Windows 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see System Requirements.