Export (0) Print
Expand All

GetModuleDefinition Method

IIS 7.0

When overridden in a derived class, retrieves the information about the management module that is associated with the module provider.

Namespace:  Microsoft.Web.Management.Server
Assembly:  Microsoft.Web.Management (in Microsoft.Web.Management.dll)

public abstract ModuleDefinition GetModuleDefinition(
	IManagementContext context
)

Parameters

context
Type: Microsoft.Web.Management.Server..::..IManagementContext
An IManagementContext that represents the calling host's management context.

Return Value

Type: Microsoft.Web.Management.Server..::..ModuleDefinition
The ModuleDefinition object that is associated with the provider.

If the module is not enabled, the return value should be nullNothingnullptrunita null reference (Nothing in Visual Basic).

The supplied context can be used to determine whether the module should be enabled.

This method is called once per connection, during the activation of a new connection.

The following example shows how to override the GetModuleDefinition method to return a module definition.

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;

}


Community Additions

ADD
Show:
© 2014 Microsoft