Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
TaskList Class
Collapse the table of content
Expand the table of content

TaskList Class

Provides a container class for methods, messages, and properties for use by the IIS Manager extensibility API. 


Namespace:  Microsoft.Web.Management.Client
Assembly:  Microsoft.Web.Management (in Microsoft.Web.Management.dll)

[SecurityPermissionAttribute(SecurityAction.Demand, Flags = SecurityPermissionFlag.UnmanagedCode)]
[SecurityPermissionAttribute(SecurityAction.InheritanceDemand, Flags = SecurityPermissionFlag.UnmanagedCode)]
public abstract class TaskList

The TaskList type exposes the following members.

Protected methodTaskListInitializes a new instance of the TaskList class.

Public propertyIsDirty Obsolete. When overridden in a derived class, gets a value indicating whether the object has changed since the last update.

Public methodEquals (Inherited from Object.)
Protected methodFinalize (Inherited from Object.)
Public methodGetHashCode (Inherited from Object.)
Public methodGetPropertyValueThis method is not supported.
Public methodGetTaskItemsWhen overridden in a derived class, returns a collection of MethodTaskItem objects.
Public methodGetType (Inherited from Object.)
Public methodInvokeMethodCalls the specified method.
Protected methodMemberwiseClone (Inherited from Object.)
Public methodSetPropertyValueThis method is not supported.
Public methodToString (Inherited from Object.)

The TaskList class is used by many classes and methods in the IIS Manager extensibility API. The HierarchyInfo, Module, and ModulePropertiesPage classes all use TaskList by including the virtual method Tasks.

Notes to Inheritors

When you inherit from TaskList, you must override the following members: IsDirty and GetTaskItems.

The following example creates a TaskList object and populates it with methods can be called from the Nodes shortcut menu in IIS Manager.

private sealed class HierarchyDemoInfoTaskList : TaskList 
    private DemoHierarchyInfo _owner;
    private bool _dirtyState = false;
    Person _curPerson = new Person(23, "Albert", "Smith");

    public HierarchyDemoInfoTaskList(DemoHierarchyInfo owner) {
        _owner = owner;

    public void Delete()


/// 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;


    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


    foreach (TaskItem item in items)
        if (item is MethodTaskItem)
            item.Enabled = true;
    return items;

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Community Additions

© 2015 Microsoft