TimeSpanValidatorAttribute.MinValueString Property

 

Gets or sets the relative minimum TimeSpan value.

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

public string MinValueString { get; set; }

Property Value

Type: System.String

The minimum allowed TimeSpan value.

Exception Condition
ArgumentOutOfRangeException

The selected value represents more than MaxValue.

This is the relative minimum value as set by the user.

The following example shows how to use the MinValueString property.

[ConfigurationProperty("maxIdleTime",
    DefaultValue = "0:10:0",
    IsRequired = false)]
[TimeSpanValidator(MinValueString = "0:0:30",
    MaxValueString = "5:00:0",
    ExcludeRange = false)]
public TimeSpan MaxIdleTime
{
    get
    {
        return (TimeSpan)this["maxIdleTime"];
    }
    set
    {
        this["maxIdleTime"] = value;
    }
}

.NET Framework
Available since 2.0
Return to top
Show: