This documentation is archived and is not being maintained.

ConfigurationPropertyAttribute.IsRequired Property

Note: This property is new in the .NET Framework version 2.0.

Gets or sets a value indicating whether the decorated element property is required.

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

public bool IsRequired { get; set; 
/** @property */
public boolean get_IsRequired ()

/** @property */
public void set_IsRequired (boolean value)

public function get IsRequired () : boolean

public function set IsRequired (value : boolean)

Property Value

true if the property is required; otherwise, false. The default is false.

The following example shows how to use the DefaultValue property.

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

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.

.NET Framework

Supported in: 2.0