다음을 통해 공유


ModuleProvider.GetModuleDefinition(IManagementContext) 메서드

정의

파생 클래스에서 재정의되는 경우 는 모듈 공급자와 연결된 관리 모듈에 대한 정보를 검색합니다.

public:
 abstract Microsoft::Web::Management::Server::ModuleDefinition ^ GetModuleDefinition(Microsoft::Web::Management::Server::IManagementContext ^ context);
public abstract Microsoft.Web.Management.Server.ModuleDefinition GetModuleDefinition (Microsoft.Web.Management.Server.IManagementContext context);
abstract member GetModuleDefinition : Microsoft.Web.Management.Server.IManagementContext -> Microsoft.Web.Management.Server.ModuleDefinition
Public MustOverride Function GetModuleDefinition (context As IManagementContext) As ModuleDefinition

매개 변수

context
IManagementContext

IManagementContext 호출 호스트의 관리 컨텍스트를 나타내는 입니다.

반환

ModuleDefinition 공급자와 연결된 개체입니다.

예제

다음 예제에서는 메서드를 재정의 GetModuleDefinition 하여 모듈 정의를 반환하는 방법을 보여 있습니다.

public override ModuleDefinition GetModuleDefinition(IManagementContext context) {


    if (context.User.Identity.IsAuthenticated != true)
        return null;

    string sModuleProviderName = this.Name;
    string sAssemblyQualifiedName = typeof(DemoModule).AssemblyQualifiedName;
    Trace.WriteLine(" ModuleProviderName : " + sModuleProviderName);
    Trace.WriteLine(" AssemblyQualifiedName : " + sAssemblyQualifiedName);

    ModuleDefinition modDefn = new ModuleDefinition(sModuleProviderName, sAssemblyQualifiedName);
    traceModDefn(modDefn);
    return modDefn;

}

설명

모듈을 사용하도록 설정하지 않으면 반환 값은 이어야 null합니다.

제공된 컨텍스트를 사용하여 모듈을 사용하도록 설정해야 하는지 여부를 확인할 수 있습니다.

이 메서드는 새 연결을 활성화하는 동안 연결당 한 번 호출됩니다.

적용 대상