SectionInformation.AllowOverride Propriedade
Definição
Importante
Algumas informações dizem respeito a um produto pré-lançado que pode ser substancialmente modificado antes de ser lançado. A Microsoft não faz garantias, de forma expressa ou implícita, em relação à informação aqui apresentada.
Recebe ou define um valor que indica se a secção de configuração associada pode ser sobreposta por ficheiros de configuração de nível inferior.
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 Propriedade
true se a secção puder ser anulada; caso contrário, false. A predefinição é false.
Exemplos
Os exemplos nesta secção mostram como obter o valor da AllowOverride propriedade após aceder à informação da secção relacionada no ficheiro de configuração.
O exemplo seguinte obtém o 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
O exemplo seguinte obtém o 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())