IControlPanel.RegisterPage Method

Definition

Registers a new feature with the Home page.

Overloads

RegisterPage(ModulePageInfo)

Registers a new feature with the Home page without categorizing it.

RegisterPage(String, ModulePageInfo)

Registers a new item in a Home page category.

RegisterPage(ModulePageInfo)

Registers a new feature with the Home page without categorizing it.

public:
 void RegisterPage(Microsoft::Web::Management::Client::ModulePageInfo ^ itemPageInfo);
public void RegisterPage (Microsoft.Web.Management.Client.ModulePageInfo itemPageInfo);
abstract member RegisterPage : Microsoft.Web.Management.Client.ModulePageInfo -> unit
Public Sub RegisterPage (itemPageInfo As ModulePageInfo)

Parameters

itemPageInfo
ModulePageInfo

The ModulePageInfo object to be registered.

Examples

protected override void OnGroup(
    ModuleListPageGrouping grouping) {
    ListView.BeginUpdate();
    try {
        if ((grouping == null) ||
            (grouping == EmptyGrouping)) {
            return;
        }

        // Get the dictionary of groups for 
        // this category type
        IDictionary<string, ListViewGroup>
            groups = GroupingsTable[grouping.Name];

        IControlPanel controlPanel =
            (IControlPanel)GetService(typeof(IControlPanel));


        foreach (PageListViewItem item
            in ListView.Items) {
            ControlPanelCategoryInfo categoryInfo =
                controlPanel.GetCategory(
                grouping.Name, item.PageInfo);
            ListViewGroup group = null;
            if (categoryInfo != null) {
                group = groups[categoryInfo.Text];
            }

            // If we couldn't find a group, 
            // assign it to the 'Other' group
            if (group == null) {
                group = groups["Other"];
            }

            item.Group = group;
        }
    } finally {
        ListView.EndUpdate();
    }
}

Remarks

The feature can be found by type.

Applies to

RegisterPage(String, ModulePageInfo)

Registers a new item in a Home page category.

public:
 void RegisterPage(System::String ^ categoryName, Microsoft::Web::Management::Client::ModulePageInfo ^ itemPageInfo);
public void RegisterPage (string categoryName, Microsoft.Web.Management.Client.ModulePageInfo itemPageInfo);
abstract member RegisterPage : string * Microsoft.Web.Management.Client.ModulePageInfo -> unit
Public Sub RegisterPage (categoryName As String, itemPageInfo As ModulePageInfo)

Parameters

categoryName
String

The name that is used to categorize the feature.

itemPageInfo
ModulePageInfo

The ModulePageInfo object to be registered.

Examples

protected override void OnGroup(
    ModuleListPageGrouping grouping) {
    ListView.BeginUpdate();
    try {
        if ((grouping == null) ||
            (grouping == EmptyGrouping)) {
            return;
        }

        // Get the dictionary of groups for 
        // this category type
        IDictionary<string, ListViewGroup>
            groups = GroupingsTable[grouping.Name];

        IControlPanel controlPanel =
            (IControlPanel)GetService(typeof(IControlPanel));


        foreach (PageListViewItem item
            in ListView.Items) {
            ControlPanelCategoryInfo categoryInfo =
                controlPanel.GetCategory(
                grouping.Name, item.PageInfo);
            ListViewGroup group = null;
            if (categoryInfo != null) {
                group = groups[categoryInfo.Text];
            }

            // If we couldn't find a group, 
            // assign it to the 'Other' group
            if (group == null) {
                group = groups["Other"];
            }

            item.Group = group;
        }
    } finally {
        ListView.EndUpdate();
    }
}

Remarks

The categoryName parameter must be one of the fields of the ControlPanelCategoryInfo class.

Applies to