LongValidatorAttribute.MinValue Property

 
System_CAPS_noteNote

The .NET API Reference documentation has a new home. Visit the .NET API Browser on docs.microsoft.com to see the new experience.

Gets or sets the minimum value allowed for the property.

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

public long MinValue { get; set; }

Property Value

Type: System.Int64

An integer that indicates the allowed minimum value.

Exception Condition
ArgumentOutOfRangeException

The selected value is greater than MaxValue.

The MinValue property value is included in the allowed range.

The following example shows how to use the MinValue property.

[ConfigurationProperty("maxUsers", DefaultValue = (long)10000,
    IsRequired = false)]
[LongValidator(MinValue = 1, MaxValue = 10000000,
    ExcludeRange = false)]
public long MaxUsers
{
    get
    {
        return (long)this["maxUsers"];
    }
    set
    {
        this["maxUsers"] = value;
    }
}

.NET Framework
Available since 2.0
Return to top
Show: