SectionInformation 클래스

정의

구성 계층 구조 내의 개별 섹션에 대한 메타데이터가 들어 있습니다. 이 클래스는 상속될 수 없습니다.

public ref class SectionInformation sealed
public sealed class SectionInformation
type SectionInformation = class
Public NotInheritable Class SectionInformation
상속
SectionInformation

예제

다음 예제에서는 개체와 ConfigurationSection 연결된 메타데이터를 SectionInformation 가져오는 방법을 보여줍니다.

static public SectionInformation 
    GetSectionInformation()
{

    // 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;

    return sInfo;
}
Public Shared Function GetSectionInformation() _
As 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

    Return sInfo

End Function 'GetSectionInformation

다음 예제는 이전 예제에서 사용하는 구성 파일의 발췌입니다.

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <configSections>
    <section name="MyUrls" type="Samples.AspNet.UrlsSection,
      ConfigurationElement, Version=1.0.0.0, Culture=neutral,
      PublicKeyToken=null" allowDefinition="Everywhere"
      allowExeDefinition="MachineToApplication"
      restartOnExternalChanges="true" />
  </configSections>
  <MyUrls name="MyFavorites">
    <simple name="Contoso" url="http://www.contoso.com" port="8080" />
    <urls>
      <clear />
      <add name="Microsoft" url="http://www.microsoft.com" port="0" />
    </urls>
  </MyUrls>
</configuration>

설명

개체에는 SectionInformation 구성 계층 내의 개별 섹션에 대한 메타데이터가 포함됩니다. 이 개체는 개별 섹션의 속성의 유효성을 검사하고 변경하기 위해 사용할 수 있습니다.

속성

AllowDefinition

구성 파일 계층 구조에서 연결된 구성 섹션을 정의할 수 있는 위치를 나타내는 값을 가져오거나 설정합니다.

AllowExeDefinition

구성 파일 계층 구조에서 연결된 구성 섹션을 선언할 수 있는 위치를 나타내는 값을 가져오거나 설정합니다.

AllowLocation

구성 섹션에서 location 특성을 사용할 수 있는지 여부를 나타내는 값을 가져오거나 설정합니다.

AllowOverride

연결된 구성 섹션을 하위 수준 구성 파일로 재정의할 수 있는지 여부를 나타내는 값을 가져오거나 설정합니다.

ConfigSource

연결된 구성 섹션이 정의되어 있는 포함 파일이 있으면 해당 파일의 이름을 가져오거나 설정합니다.

ConfigurationBuilder

이 구성 섹션에 대한 ConfigurationBuilder 개체를 가져옵니다.

ForceSave

연결된 구성 섹션이 수정되지 않은 경우에도 저장되는지 여부를 나타내는 값을 가져오거나 설정합니다.

InheritInChildApplications

연결된 구성 섹션에 지정된 설정이 관련 애플리케이션의 하위 디렉터리에 있는 애플리케이션에서 상속되는지 여부를 나타내는 값을 가져오거나 설정합니다.

IsDeclarationRequired

구성 섹션을 구성 파일에 선언해야 하는지 여부를 나타내는 값을 가져옵니다.

IsDeclared

연결된 구성 섹션이 구성 파일에 선언되어 있는지 여부를 나타내는 값을 가져옵니다.

IsLocked

연결된 구성 섹션이 잠겨 있는지 여부를 나타내는 값을 가져옵니다.

IsProtected

연결된 구성 섹션이 보호되는지 여부를 나타내는 값을 가져옵니다.

Name

연결된 구성 섹션의 이름을 가져옵니다.

OverrideMode

연결된 구성 섹션을 자식 구성 파일에서 재정의할 수 있는지 여부를 지정하는 OverrideMode 열거형 값을 가져오거나 설정합니다.

OverrideModeDefault

자식 구성 파일에 의한 구성 섹션의 기본 재정의 동작을 지정하는 값을 가져오거나 설정합니다.

OverrideModeEffective

자식 구성 파일에서 구성 섹션을 잠글 수 있는지 여부에 따른 구성 섹션의 재정의 동작을 가져옵니다.

ProtectionProvider

연결된 구성 섹션의 보호되는 구성 공급자를 가져옵니다.

RequirePermission

연결된 구성 섹션에 액세스 권한이 필요한지 여부를 나타내는 값을 가져옵니다.

RestartOnExternalChanges

외부 구성 포함 파일을 변경할 때 애플리케이션을 다시 시작해야 하는지 여부를 지정하는 값을 가져오거나 설정합니다.

SectionName

연결된 구성 섹션의 이름을 가져옵니다.

Type

섹션 클래스의 이름을 가져오거나 설정합니다.

메서드

Equals(Object)

지정된 개체가 현재 개체와 같은지 확인합니다.

(다음에서 상속됨 Object)
ForceDeclaration()

연결된 구성 섹션이 구성 파일에 나타나도록 합니다.

ForceDeclaration(Boolean)

연결된 구성 섹션을 구성 파일에 표시하거나 구성 파일에서 기존 섹션을 제거합니다.

GetHashCode()

기본 해시 함수로 작동합니다.

(다음에서 상속됨 Object)
GetParentSection()

이 개체와 연결된 구성 섹션이 포함된 구성 섹션을 가져옵니다.

GetRawXml()

연결된 구성 섹션 개체를 나타내는 XML 노드 개체를 반환합니다.

GetType()

현재 인스턴스의 Type을 가져옵니다.

(다음에서 상속됨 Object)
MemberwiseClone()

현재 Object의 단순 복사본을 만듭니다.

(다음에서 상속됨 Object)
ProtectSection(String)

보호를 위해 구성 섹션에 표시합니다.

RevertToParent()

연결된 구성 섹션이 부모 섹션에서 모든 값을 상속하도록 합니다.

SetRawXml(String)

구성 파일에 있는 연결된 구성 섹션의 XML 표현으로 개체를 설정합니다.

ToString()

현재 개체를 나타내는 문자열을 반환합니다.

(다음에서 상속됨 Object)
UnprotectSection()

연결된 구성 섹션에서 보호되는 구성 암호화를 제거합니다.

적용 대상

추가 정보