ConfigurationSectionGroup.IsDeclared 屬性

定義

取得值,指出這個 ConfigurationSectionGroup 物件是否已宣告。

public:
 property bool IsDeclared { bool get(); };
public bool IsDeclared { get; }
member this.IsDeclared : bool
Public ReadOnly Property IsDeclared As Boolean

屬性值

如果這個 ConfigurationSectionGroup 已宣告,則為 true,否則為 false。 預設為 false

範例

下列程式代碼範例會判斷 是否宣告這個的實例 ConfigurationSectionGroup 。 這是類別概觀 ConfigurationSectionGroup 中提供之較大範例的一部分。

indent("Is Group Declared?: " + sectionGroup.IsDeclared);
indent("Is Group Declared?: " + _
    sectionGroup.IsDeclared.ToString())

備註

如果在群組態檔中宣告區段群組,則 IsDeclared 屬性會傳 true回 。

如果此區段繼承自 Machine.config 或父組態檔,則 IsDeclared 屬性會 false 傳回 。

適用於

另請參閱