SectionInformation.GetParentSection Methode

Definitie

Hiermee haalt u de configuratiesectie op die de configuratiesectie bevat die aan dit object is gekoppeld.

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

Retouren

De configuratiesectie die de ConfigurationSection configuratie bevat die aan dit SectionInformation object is gekoppeld.

Uitzonderingen

De methode wordt aangeroepen vanuit een bovenliggende sectie.

Voorbeelden

In het volgende voorbeeld ziet u hoe u de GetParentSection methode gebruikt.

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

Opmerkingen

Als dit ConfigurationSection object geen bovenliggende secties heeft, retourneert de GetParentSection methode dezelfde waarde als de Name eigenschap.

Van toepassing op