SectionInformation.AllowOverride Propiedad

Definición

Obtiene o establece un valor que indica si los archivos de configuración con un nivel inferior pueden invalidar la sección de configuración asociada.

public:
 property bool AllowOverride { bool get(); void set(bool value); };
public bool AllowOverride { get; set; }
member this.AllowOverride : bool with get, set
Public Property AllowOverride As Boolean

Valor de propiedad

Es true si se puede invalidar la sección; de lo contrario, es false. De manera predeterminada, es false.

Ejemplos

Los ejemplos de esta sección muestran cómo obtener el valor de propiedad AllowOverride después de acceder a la información de sección relacionada en el archivo de configuración.

En el ejemplo siguiente se obtiene el SectionInformation objeto .

// Get the current configuration file.
System.Configuration.Configuration config =
        ConfigurationManager.OpenExeConfiguration(
        ConfigurationUserLevel.None);

// Get the section.
UrlsSection section =
    (UrlsSection)config.GetSection("MyUrls");

SectionInformation sInfo =
    section.SectionInformation;
' Get the current configuration file.
Dim config _
As System.Configuration.Configuration = _
ConfigurationManager.OpenExeConfiguration( _
ConfigurationUserLevel.None)

' Get the section.
Dim section As UrlsSection = _
CType(config.GetSection("MyUrls"), UrlsSection)

Dim sInfo As SectionInformation = _
section.SectionInformation

En el ejemplo siguiente se obtiene el AllowOverride valor .

bool allowOverride =
    sInfo.AllowOverride;
Console.WriteLine("Allow override: {0}",
               allowOverride.ToString());
Dim allowOverride As Boolean = _
sInfo.AllowOverride
Console.WriteLine("Allow override: {0}", _
allowOverride.ToString())

Se aplica a