Module Class

Definition

Provides the main entry point in the client for all extensibility objects.

public ref class Module abstract : IDisposable, IServiceProvider
public abstract class Module : IDisposable, IServiceProvider
type Module = class
    interface IServiceProvider
    interface IDisposable
Public MustInherit Class Module
Implements IDisposable, IServiceProvider
Inheritance
Module
Implements

Examples

The following example shows how to create a module that derives from the Module class.


internal class DemoModule : Microsoft.Web.Management.Client.Module 
{

    protected override void Initialize(
        IServiceProvider serviceProvider, ModuleInfo moduleInfo) 
    {

        base.Initialize(serviceProvider, moduleInfo);
        Trace.WriteLine(" ClientModuleTypeName : " + 
            moduleInfo.ClientModuleTypeName);
        Trace.WriteLine(" Name : " + moduleInfo.Name);
        
        // Clear the trace window.
        resetTrace();

        IControlPanel controlPanel = 
            (IControlPanel)GetService(typeof(IControlPanel));
        ModulePageInfo modPgInfo = getModulePage();

        controlPanel.RegisterPage(modPgInfo);
        controlPanel.RegisterPage(
            ControlPanelCategoryInfo.HealthAndDiagnostics, modPgInfo);

        /// The ExtensibilityManager is used to add a new icon/element 
        /// to the InetMgr UI in the Connections frame.

        IExtensibilityManager extensMgr = 
            (IExtensibilityManager)GetService(
            typeof(IExtensibilityManager));
        System.Diagnostics.Debug.Assert(extensMgr != null);

        extensMgr.RegisterExtension(typeof(HierarchyProvider), 
            new DemoHierProvidr(serviceProvider));

        ICollection extenCol = 
            extensMgr.GetExtensions(typeof(HierarchyProvider));
        Trace.WriteLine(
            "extensMgr collection cnt = " + extenCol.Count.ToString());
        foreach (HierarchyProvider col in extenCol) 
        {
            Trace.WriteLine(col.ToString());
        }
        
        traceModInfo(modPgInfo);
    }

Notes to Implementers

When you inherit from Module, you must override the following members: Tasks and Initialize(IServiceProvider, ModuleInfo).

Constructors

Module()

Initializes a new instance of the Module class.

Fields

FxVersion10

Represents the .NET Framework version 1.0.

FxVersion11

Represents the .NET Framework version 1.1.

FxVersion20

Represents the .NET Framework version 2.0.

FxVersionNotRequired

Indicates that the .NET Framework is not required.

Properties

MinimumFrameworkVersion

Gets the lowest version of the .NET Framework that is required by the module.

ModuleInfo

Gets the ModuleInfo instance that was passed to the Initialize(IServiceProvider, ModuleInfo) method.

Tasks

When overridden in a derived class, gets the task list for the module.

Methods

Dispose()

Releases all resources used by the Module.

GetService(Type)

Retrieves the requested service.

Initialize(IServiceProvider, ModuleInfo)

When overridden in a derived class, initializes the module.

IsPageEnabled(ModulePageInfo)

Returns a value indicating whether the specified page of the module is enabled.

Explicit Interface Implementations

IDisposable.Dispose()

For a description of this member, see Dispose(),

IServiceProvider.GetService(Type)

For a description of this member, see GetService(Type).

Applies to