ConfigurationSection.GetRuntimeObject 메서드

정의

파생 클래스에서 재정의될 때 사용자 지정 개체를 반환합니다.

protected:
 virtual System::Object ^ GetRuntimeObject();
protected public:
 virtual System::Object ^ GetRuntimeObject();
protected virtual object GetRuntimeObject ();
protected internal virtual object GetRuntimeObject ();
abstract member GetRuntimeObject : unit -> obj
override this.GetRuntimeObject : unit -> obj
Protected Overridable Function GetRuntimeObject () As Object
Protected Friend Overridable Function GetRuntimeObject () As Object

반환

섹션을 나타내는 개체입니다.

예제

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

// Customizes the use of CustomSection
// by setting _ReadOnly to false.
// Remember you must use it along with ThrowIfReadOnly.
protected override object GetRuntimeObject()
{
    // To enable property setting just assign true to
    // the following flag.
    _ReadOnly = true;
    return base.GetRuntimeObject();
}
' Customizes the use of CustomSection
 ' by setting _ReadOnly to false.
' Remember you must use it along with ThrowIfReadOnly.
Protected Overrides Function GetRuntimeObject() As Object
   ' To enable property setting just assign true to
   ' the following flag.
   _ReadOnly = True
   Return MyBase.GetRuntimeObject()
End Function 'GetRuntimeObject

설명

런타임에 메서드가 GetSection 호출되면 구성 시스템은 먼저 클래스의 ConfigurationSection 적절한 instance 만든 다음 메서드에서 가져온 개체를 GetRuntimeObject 반환합니다.

기본적으로 는 GetRuntimeObject 호출되는 을 ConfigurationSection 나타내는 개체를 반환합니다.

상속자 참고

런타임에 사용자 지정 형식을 GetRuntimeObject() 반환하도록 메서드를 재정의할 수 있습니다.

예를 들어 클래스에서 설정의 런타임 수정을 제한하려면 수정할 수 있는 ConfigurationSection 설정(있는 경우)에 대한 제한을 적용하는 사용자 지정 형식을 재정 GetRuntimeObject() 의하고 반환할 수 있습니다.

런타임 개체가 내부 전용인 경우 반환된 개체를 정의하는 어셈블리 외부에서 사용할 수 없습니다. 런타임에 어셈블리의 코드에서 ConfigurationSection 만 파생되고 액세스할 수 있는 개체를 만드는 한 가지 방법은 구현을 반환하는 메서드가 있는 내부 런타임 개체를 만드는 것입니다 ConfigurationSection .

적용 대상