C# Class Microsoft.Silverlight.Testing.Harness.CompositeWorkItem

TestWorkItem which can contain sub-tasks; the underlying work item is not marked complete until the Children have completed or an Exception is thrown.
Inheritance: WorkItem
Mostra file Open project: garyjohnson/wpnest Class Usage Examples

Public Methods

Method Description
CompositeWorkItem ( ) : System

Constructor for the TestTaskContainer type.

Dequeue ( ) : WorkItem

Dequeue a work item.

Enqueue ( System.Action action ) : void

Add a new callback action and schedule it for invocation.

Enqueue ( WorkItem item ) : void

Add a new work item to the container to schedule it for invocation.

EnqueueQuick ( System.Action action ) : void

Enqueues a callback or action that will quickly execute.

EnqueueQuick ( WorkItem item ) : void

Adds a new work item that will execute more quickly.

Invoke ( ) : bool

Invoke the test container; in turn will execute child work items as needed. Supports executing multiple items immediately for performance reasons.

Peek ( ) : WorkItem

Return the top work item, if any, from this container.

Protected Methods

Method Description
ClearChildren ( ) : void

Clear the children.

FirstInvoke ( ) : void

Optional method to call on the first invoke.

OnComplete ( EventArgs e ) : void

Fire the Complete event.

OnUnhandledException ( Exception exception ) : void

Fire the unhandled exception event.

WorkItemComplete ( ) : void

Work items must call this method to indicate completion of the work item; in turn fires the Complete event delegates.

Private Methods

Method Description
Invoke ( WorkItem &usedWorkItem ) : bool
WorkItemCompleteInternal ( ) : void

Internal-only version which can be called during a test completion through the relation - not necessarily the best design; events may make more sense long-term.

WorkItemException ( Exception e ) : void

Call when an exception occurs inside a work item.

Method Details

ClearChildren() protected method

Clear the children.
protected ClearChildren ( ) : void
return void

CompositeWorkItem() public method

Constructor for the TestTaskContainer type.
public CompositeWorkItem ( ) : System
return System

Dequeue() public method

Dequeue a work item.
public Dequeue ( ) : WorkItem
return WorkItem

Enqueue() public method

Add a new callback action and schedule it for invocation.
public Enqueue ( System.Action action ) : void
action System.Action The action.
return void

Enqueue() public method

Add a new work item to the container to schedule it for invocation.
public Enqueue ( WorkItem item ) : void
item WorkItem New test work item to enqueue.
return void

EnqueueQuick() public method

Enqueues a callback or action that will quickly execute.
public EnqueueQuick ( System.Action action ) : void
action System.Action The action or method.
return void

EnqueueQuick() public method

Adds a new work item that will execute more quickly.
public EnqueueQuick ( WorkItem item ) : void
item WorkItem The item of work.
return void

FirstInvoke() protected method

Optional method to call on the first invoke.
protected FirstInvoke ( ) : void
return void

Invoke() public method

Invoke the test container; in turn will execute child work items as needed. Supports executing multiple items immediately for performance reasons.
public Invoke ( ) : bool
return bool

OnComplete() protected method

Fire the Complete event.
protected OnComplete ( EventArgs e ) : void
e System.EventArgs Empty event arguments.
return void

OnUnhandledException() protected method

Fire the unhandled exception event.
protected OnUnhandledException ( Exception exception ) : void
exception System.Exception Exception object.
return void

Peek() public method

Return the top work item, if any, from this container.
public Peek ( ) : WorkItem
return WorkItem

WorkItemComplete() protected method

Work items must call this method to indicate completion of the work item; in turn fires the Complete event delegates.
protected WorkItemComplete ( ) : void
return void