Share via


IControlPanel.Categorizations Property

Definition

Gets the collection of categories that have been registered for the Home page of a connection in IIS Manager.

public:
 property System::Collections::ObjectModel::ReadOnlyCollection<Microsoft::Web::Management::Client::ControlPanelCategorization ^> ^ Categorizations { System::Collections::ObjectModel::ReadOnlyCollection<Microsoft::Web::Management::Client::ControlPanelCategorization ^> ^ get(); };
public System.Collections.ObjectModel.ReadOnlyCollection<Microsoft.Web.Management.Client.ControlPanelCategorization> Categorizations { get; }
member this.Categorizations : System.Collections.ObjectModel.ReadOnlyCollection<Microsoft.Web.Management.Client.ControlPanelCategorization>
Public ReadOnly Property Categorizations As ReadOnlyCollection(Of ControlPanelCategorization)

Property Value

A constructed generic ReadOnlyCollection<T> of ControlPanelCategorization objects that represents the collection of categories that have been registered for the Home page.

Examples

The following example displays the following trace listener output:

key : "Function" DisplayName: "Category"

key : "Role" DisplayName: "Area"

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

    protected override void Initialize(
        IServiceProvider serviceProvider,
        ModuleInfo moduleInfo) {
        base.Initialize(serviceProvider, moduleInfo);
        IControlPanel cp =
            (IControlPanel)GetService(typeof(IControlPanel));
        ModulePageInfo modulePageInfo = new ModulePageInfo(
            this,
            typeof(DemoPage),
            "My Page Title 4",
            "My Page Description 4",
            rLoadImg.loadImgs("rSmall.bmp"),   // small image
            rLoadImg.loadImgs("rLarge.bmp"),  // large image
            "My Page long description 4"     // long description
            );

        cp.RegisterPage(modulePageInfo);

        // Register the Category as
        // Application Development
        string s = 
            ControlPanelCategoryInfo.ApplicationDevelopment;
        cp.RegisterPage(s, modulePageInfo);

        // Register the Area as IIS
        s = ControlPanelCategoryInfo.Iis;
        cp.RegisterPage(s, modulePageInfo);
      //  cp.RegisterHomepage(modulePageInfo);

    }
}
IControlPanel controlPanel =
     (IControlPanel)GetService(typeof(IControlPanel));
foreach (ControlPanelCategorization cpc in
    controlPanel.Categorizations)
    Trace.WriteLine("key : \"" + cpc.Key +
        "\"\t DisplayName: \"" + cpc.DisplayName
        + "\"");

Remarks

Each category is represented by a ControlPanelCategoryInfo object. The keys in the dictionary are the category names.

Applies to