SectionInformation.GetParentSection 메서드

정의

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

public:
 System::Configuration::ConfigurationSection ^ GetParentSection();
public System.Configuration.ConfigurationSection GetParentSection ();
member this.GetParentSection : unit -> System.Configuration.ConfigurationSection
Public Function GetParentSection () As ConfigurationSection

반환

ConfigurationSection 개체에 연결된 SectionInformation이 들어 있는 구성 섹션입니다.

예외

메서드가 부모 섹션에서 호출된 경우

예제

다음 예제에서는 GetParentSection 메서드를 사용하는 방법을 보여 줍니다.

static public void GetParentSection()
{
    SectionInformation sInfo = 
        GetSectionInformation();

    ConfigurationSection parentSection =
        sInfo.GetParentSection();

    Console.WriteLine("Parent section : {0}",
        parentSection.SectionInformation.Name);
}
Public Shared Sub GetParentSection() 

    Dim sInfo As SectionInformation = _
    GetSectionInformation()
    
    Dim parentSection _
    As ConfigurationSection = _
    sInfo.GetParentSection()
    
    Console.WriteLine("Parent section : {0}", _
    parentSection.SectionInformation.Name)

End Sub

설명

ConfigurationSection 개체에 부모 섹션이 없으면 메서드는 GetParentSection 속성과 동일한 값을 Name 반환합니다.

적용 대상