MaxValueString Property
Collapse the table of content
Expand the table of content

TimeSpanValidatorAttribute.MaxValueString Property

 

Gets or sets the relative maximum TimeSpan value.

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

public string MaxValueString { get; set; }

Property Value

Type: System.String

The allowed maximum TimeSpan value.

Exception Condition
ArgumentOutOfRangeException

The selected value represents less than MinValue.

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

The following example shows how to use the MaxValueString 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:
© 2016 Microsoft