SectionInformation.IsDeclared Özellik
Tanım
Önemli
Bazı bilgiler ürünün ön sürümüyle ilgilidir ve sürüm öncesinde önemli değişiklikler yapılmış olabilir. Burada verilen bilgilerle ilgili olarak Microsoft açık veya zımni hiçbir garanti vermez.
İlişkili yapılandırma bölümünün yapılandırma dosyasında bildirilip bildirildiğini gösteren bir değer alır.
public:
property bool IsDeclared { bool get(); };
public bool IsDeclared { get; }
member this.IsDeclared : bool
Public ReadOnly Property IsDeclared As Boolean
Özellik Değeri
true bu ConfigurationSection , yapılandırma dosyasında bildirilirse; aksi takdirde , false. Varsayılan değer: true.
Örnekler
Bu bölümdeki örneklerde, yapılandırma dosyasındaki IsDeclared ilgili bölüm bilgilerine erişildikten sonra özellik değerinin nasıl alınacakları gösterilmektedir.
Aşağıdaki örnek nesnesini alır SectionInformation .
// 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
Aşağıdaki örnek değeri alır IsDeclared .
bool declared =
sInfo.IsDeclared;
Console.WriteLine("Section declared?: {0}",
declared.ToString());
Dim declared As Boolean = _
sInfo.IsDeclared
Console.WriteLine("Section declared?: {0}", _
declared.ToString())