Export (0) Print
Expand All
This topic has not yet been rated - Rate this topic

RegisterCategory Method

IIS 7.0

Registers a new category of features in the Home page.

Namespace:  Microsoft.Web.Management.Client
Assembly:  Microsoft.Web.Management (in Microsoft.Web.Management.dll)
void RegisterCategory(
	ControlPanelCategoryInfo categoryInfo
)

If the category is already registered, this registration is ignored.

The following example shows how to register a new category.

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

    protected override void Initialize(IServiceProvider serviceProvider,
        ModuleInfo moduleInfo) {
        base.Initialize(serviceProvider, moduleInfo);
        IControlPanel controlPanel = (IControlPanel)
            GetService(typeof(IControlPanel));
        ModulePageInfo customPage = new ModulePageInfo(this,
            typeof(MyCustomPage),
            "Title ModuleDialogPage",
            "ModuleDialogPage Description",
            rLoadImg.loadImgs("rSmall.bmp"),         // small image
            rLoadImg.loadImgs("rLarge.bmp"),         // large image
            "long ModuleDialogPage description here"  // long description
            );
        controlPanel.RegisterPage(customPage);
        string s;
        // Show in the Perf category
        s = ControlPanelCategoryInfo.Performance;
        controlPanel.RegisterPage(s, customPage);

        //------------------------------------------------------
        // Create a new category registered for Area Categorization

        // Find the Area Categorization
        ControlPanelCategorization areaCat = null;
        foreach (ControlPanelCategorization categorization in
            controlPanel.Categorizations) {
            if (categorization.Key ==
                ControlPanelCategorization.AreaCategorization) {
                areaCat = categorization;
                break;
            }
        }
        // Create the new category to display under Area
        ControlPanelCategoryInfo myCategory =
            new ControlPanelCategoryInfo(
            "My-E-business",
            "My E-business Area Category",
            "This is the description for my Area category",
            areaCat);

        controlPanel.RegisterCategory(myCategory);
        controlPanel.RegisterPage(myCategory.Name, customPage);

    }
} 


Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.