Export (0) Print
Expand All

Module Class

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

System..::..Object
  Microsoft.Web.Management.Client..::..Module

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

[SecurityPermissionAttribute(SecurityAction.Demand, Flags = SecurityPermissionFlag.UnmanagedCode)]
[SecurityPermissionAttribute(SecurityAction.InheritanceDemand, Flags = SecurityPermissionFlag.UnmanagedCode)]
public abstract class Module : IServiceProvider, 
	IDisposable

The Module type exposes the following members.

  NameDescription
Protected methodModuleInitializes a new instance of the Module class.
Top

  NameDescription
Public propertyMinimumFrameworkVersionGets the lowest version of the .NET Framework that is required by the module.
Public propertyModuleInfoGets the ModuleInfo instance that was passed to the Initialize method.
Public propertyTasksWhen overridden in a derived class, gets the task list for the module.
Top

  NameDescription
Protected methodDisposeReleases all resources used by the Module.
Public methodEquals (Inherited from Object.)
Protected methodFinalize (Inherited from Object.)
Public methodGetHashCode (Inherited from Object.)
Protected methodGetServiceRetrieves the requested service.
Public methodGetType (Inherited from Object.)
Protected methodInitializeWhen overridden in a derived class, initializes the module.
Protected methodIsPageEnabledReturns a value indicating whether the specified page of the module is enabled.
Protected methodMemberwiseClone (Inherited from Object.)
Public methodToString (Inherited from Object.)
Top

  NameDescription
Protected fieldStatic memberFxVersion10Represents the .NET Framework version 1.0.
Protected fieldStatic memberFxVersion11Represents the .NET Framework version 1.1.
Protected fieldStatic memberFxVersion20Represents the .NET Framework version 2.0.
Protected fieldStatic memberFxVersionNotRequiredIndicates that the .NET Framework is not required.
Top

Notes to Inheritors

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

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);
    }


Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Community Additions

ADD
Show:
© 2014 Microsoft