IControlPanel.RegisterCategory(ControlPanelCategoryInfo) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Registers a new category of features in the Home page.
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)
Parameters
- categoryInfo
- ControlPanelCategoryInfo
The ControlPanelCategoryInfo object to register.
Examples
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);
}
}
Remarks
If the category is already registered, this registration is ignored.