Export (0) Print
Expand All

TaskList Class

IIS 7.0

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

System..::..Object
  Microsoft.Web.Management.Client..::..TaskList

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.

  NameDescription
Protected methodTaskListInitializes a new instance of the TaskList class.
Top

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

  NameDescription
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.)
Top

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()
    {
        _owner.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;
    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
          ); 



...


    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

ADD
Show:
© 2014 Microsoft