Export (0) Print
Expand All

SequenceActivity Class

Runs a set of child activities according to a single defined ordering.

Namespace:  System.Workflow.Activities
Assembly:  System.Workflow.Activities (in System.Workflow.Activities.dll)

[ToolboxBitmapAttribute(typeof(SequenceActivity), "Resources.Sequence.png")]
public class SequenceActivity : CompositeActivity, 
	IActivityEventListener<ActivityExecutionStatusChangedEventArgs>

The SequenceActivity is a CompositeActivity, meaning the SequenceActivity can contain other activities.

The SequenceActivity class coordinates the running of a set of child activities in an ordered manner, one at a time. The SequenceActivity is completed when the final child activity is finished.

Classes that derive from SequenceActivity should not implement the IActivityEventListener<T> interface, or the derived class will not execute correctly.

The following code example demonstrates how to create a new instance of the SequenceActivity class and add the SequenceActivity classes to the ParallelActivity class. This code example is part of the WhileAndParallel SDK Sample from the WhileAndParallelWorkflow.Designer.cs file. For more information, see Using While and Parallel.

this.WhileLoop = new System.Workflow.Activities.WhileActivity();
this.Parallel = new System.Workflow.Activities.ParallelActivity();
this.Sequence1 = new System.Workflow.Activities.SequenceActivity();
this.Sequence2 = new System.Workflow.Activities.SequenceActivity();
this.ConsoleMessage1 = new System.Workflow.Activities.CodeActivity();
this.ConsoleMessage2 = new System.Workflow.Activities.CodeActivity();
//  
// WhileLoop 
//  
this.WhileLoop.Activities.Add(this.Parallel);
codecondition1.Condition += new System.EventHandler<System.Workflow.Activities.ConditionalEventArgs>(this.WhileCondition);
this.WhileLoop.Condition = codecondition1;
this.WhileLoop.Name = "WhileLoop";
//  
// Parallel 
//  
this.Parallel.Activities.Add(this.Sequence1);
this.Parallel.Activities.Add(this.Sequence2);
this.Parallel.Name = "Parallel";

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

Windows 7, Windows Vista, Windows XP SP2, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003

The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

.NET Framework

Supported in: 3.5, 3.0

Community Additions

ADD
Show:
© 2014 Microsoft