IControlPanel.GetPages Method

Definition

Retrieves a collection of registered features.

Overloads

GetPages(Module)

Retrieves the collection of features that are registered in the specified module.

GetPages(String, String)

Retrieves the collection of features that are registered in the specified category.

GetPages(Module)

Retrieves the collection of features that are registered in the specified module.

public:
 System::Collections::ObjectModel::ReadOnlyCollection<Microsoft::Web::Management::Client::ModulePageInfo ^> ^ GetPages(Microsoft::Web::Management::Client::Module ^ module);
public System.Collections.ObjectModel.ReadOnlyCollection<Microsoft.Web.Management.Client.ModulePageInfo> GetPages (Microsoft.Web.Management.Client.Module module);
abstract member GetPages : Microsoft.Web.Management.Client.Module -> System.Collections.ObjectModel.ReadOnlyCollection<Microsoft.Web.Management.Client.ModulePageInfo>

Parameters

module
Module

The target Module object.

Returns

A constructed generic ReadOnlyCollection<T> of ModulePageInfo objects that represent the features that are registered by the specified module.

Examples

The following example sends feature details from every module to the trace listener.

void TracePageInfo(ModulePageInfo pi) {

    Trace.WriteLine("Description \""
        + pi.Description + "\"");
    Trace.WriteLine("IsEnabled \""
        + pi.IsEnabled.ToString() + "\"");
    Trace.WriteLine("LongDescription \""
        + pi.LongDescription + "\"");
    Trace.WriteLine("PageType.Assembly.FullName \""
        + pi.PageType.Assembly.FullName + "\"");
    Trace.WriteLine("PageType.FullName \""
        + pi.PageType.FullName + "\"");
    Trace.WriteLine("Title \"" + pi.Title + "\"");

}

void TrcPages() {
    IControlPanel controlPanel =
        (IControlPanel)GetService(typeof(IControlPanel));

    DictionaryEntry[] myArr = new
        DictionaryEntry[Connection.Modules.Count];
    Connection.Modules.CopyTo(myArr, 0);

    for (int i = 0; i < myArr.Length; i++) {
        Trace.WriteLine("Key: \"" + myArr[i].Key +
            "\" val: \"" + myArr[i].Value + "\"");
        Trace.Indent();
        Module module = (Module)myArr[i].Value;

        if (module != null) {
            ICollection pageInfos =
                controlPanel.GetPages(module);
            foreach (ModulePageInfo pageInfo in pageInfos) {
                Trace.Indent();
                TracePageInfo(pageInfo);
                Trace.Unindent();
            }
        }
        Trace.Unindent();
    }
}

Applies to

GetPages(String, String)

Retrieves the collection of features that are registered in the specified category.

public:
 System::Collections::ObjectModel::ReadOnlyCollection<Microsoft::Web::Management::Client::ModulePageInfo ^> ^ GetPages(System::String ^ categorization, System::String ^ categoryName);
public System.Collections.ObjectModel.ReadOnlyCollection<Microsoft.Web.Management.Client.ModulePageInfo> GetPages (string categorization, string categoryName);
abstract member GetPages : string * string -> System.Collections.ObjectModel.ReadOnlyCollection<Microsoft.Web.Management.Client.ModulePageInfo>
Public Function GetPages (categorization As String, categoryName As String) As ReadOnlyCollection(Of ModulePageInfo)

Parameters

categorization
String

The category string that was used to register the category.

categoryName
String

The category name for the returned collection.

Returns

A constructed generic ReadOnlyCollection<T> of ModulePageInfo objects that represent the features that are registered in the specified category.

Examples

The following example sends every feature title and description to the trace listener.

List<string> GetAllCategories(ICollection categories) {

    List<string> strLst = new List<string>();

    if (categories != null)
        foreach (ControlPanelCategoryInfo cpci in categories)
            strLst.Add(cpci.Name);

    // cpci.Text is the "friendly name"
    // such as "Application Development"
    // while cpci.Name is "ApplicationDevelopment"

    return strLst;
}
    void TrcGetPgs(string cpc) {

        Trace.Indent();
        IControlPanel controlPanel =
(IControlPanel)GetService(typeof(IControlPanel));

        List<string> strLst =
            GetAllCategories(controlPanel.GetCategories(cpc));
        ReadOnlyCollection<ModulePageInfo> roc;
        foreach (string s in strLst) {
            Trace.WriteLine(s);
            try {
                roc = controlPanel.GetPages(cpc, s);
                TrcGetPgs(roc);
            } catch (KeyNotFoundException) {
                Trace.WriteLine("Exception: \"" +
                    s + "\"  Not found");
            }
        }
    }

    void TrcGetPgs(ReadOnlyCollection<ModulePageInfo> roc) {

        Trace.Indent();

        for (int i = 0; i < roc.Count; i++) {
            Trace.WriteLine(roc[i].Title + "\t\t\"" +
                roc[i].LongDescription + "\"");
        }
        Trace.Unindent();
    }

    void TrcGetPgs() {

        Trace.WriteLine("\n ControlPanelCategorization = " +
            "AreaCategorization");
        TrcGetPgs(ControlPanelCategorization.
            AreaCategorization);

        Trace.WriteLine("\n ControlPanelCategorization = " +
            "CategoryCategorization");
        TrcGetPgs(ControlPanelCategorization.
            CategoryCategorization);

    }

Remarks

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

Applies to