Share via


HierarchyInfo.Tasks Property

Definition

Gets a container of user-definable methods.

public:
 virtual property Microsoft::Web::Management::Client::TaskListCollection ^ Tasks { Microsoft::Web::Management::Client::TaskListCollection ^ get(); };
public virtual Microsoft.Web.Management.Client.TaskListCollection Tasks { get; }
member this.Tasks : Microsoft.Web.Management.Client.TaskListCollection
Public Overridable ReadOnly Property Tasks As TaskListCollection

Property Value

A TaskListCollection object that contains a list of methods and their associated metadata.

Examples

The following example implements the Tasks property.


/// GetTaskItems() is called every time the context menu is invoked.
public override System.Collections.ICollection GetTaskItems() {

    ArrayList items = new ArrayList();

    Image imgAsk = rLoadImg.loadImgs(SystemIcons.Asterisk, 16);
    Image imgErr = rLoadImg.loadImgs(SystemIcons.Error, 16);

    items.Add(new MethodTaskItem(
                "DisplayTime",       // Method Name
                "Show Time",        // Menu item Text
                "DemoCategory")    // Category
                );

    Person prs = new Person(66, "Joe", "Smith");
    MethodTaskItem mti_i = new MethodTaskItem(
                                    "InvTst",       // Method Name
                                    "Invoke Test",   // Menu item Text
                                    sDemoCat,       // Category
                                    "Tool Tip:SC",  // ToolTip non-functional
                                    imgAsk,          // Menu Icon
                                    prs);      // user data
    mti_i.CausesNavigation = false;
    traceMTI(mti_i);

    items.Add(mti_i);


    items.Add(new MethodTaskItem(
          "ShowCnt",       // Method Name
          "Show Count",   // Menu item Text
          sDemoCat,       // Category
          "Tool Tip:SC",  // ToolTip non-functional
          mti_i.Image)    // Menu Icon
          );

}

Remarks

This property implements commands that are exposed on the shortcut menu for a node.

Applies to