Compartir a través de


IControlPanel.RegisterCategory(ControlPanelCategoryInfo) Método

Definición

Registra una nueva categoría de características en la página principal .

public:
 void RegisterCategory(Microsoft::Web::Management::Client::ControlPanelCategoryInfo ^ categoryInfo);
public void RegisterCategory (Microsoft.Web.Management.Client.ControlPanelCategoryInfo categoryInfo);
abstract member RegisterCategory : Microsoft.Web.Management.Client.ControlPanelCategoryInfo -> unit
Public Sub RegisterCategory (categoryInfo As ControlPanelCategoryInfo)

Parámetros

categoryInfo
ControlPanelCategoryInfo

Objeto ControlPanelCategoryInfo que se va a registrar.

Ejemplos

En el ejemplo siguiente se muestra cómo registrar una nueva categoría.

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

    }
} 

Comentarios

Si la categoría ya está registrada, este registro se omite.

Se aplica a