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)

Syntax

Visual Basic (Declaration)
Public Class SequenceActivity
    Inherits CompositeActivity
    Implements IActivityEventListener(Of ActivityExecutionStatusChangedEventArgs)
Visual Basic (Usage)
Dim instance As SequenceActivity
C#
public class SequenceActivity : CompositeActivity, IActivityEventListener<ActivityExecutionStatusChangedEventArgs>
C++
public ref class SequenceActivity : public CompositeActivity, IActivityEventListener<ActivityExecutionStatusChangedEventArgs^>
J#
public class SequenceActivity extends CompositeActivity implements IActivityEventListener<ActivityExecutionStatusChangedEventArgs>
JScript
public class SequenceActivity extends CompositeActivity implements IActivityEventListener<ActivityExecutionStatusChangedEventArgs>
XAML
Not applicable.
Remarks

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 interface, or the derived class will not execute correctly.

Example

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.

C#
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";
// 
// Sequence1
// 
this.Sequence1.Activities.Add(this.ConsoleMessage1);
this.Sequence1.Name = "Sequence1";
// 
// Sequence2
// 
this.Sequence2.Activities.Add(this.ConsoleMessage2);
this.Sequence2.Name = "Sequence2";
Inheritance Hierarchy

System.Object
   System.Workflow.ComponentModel.DependencyObject
     System.Workflow.ComponentModel.Activity
       System.Workflow.ComponentModel.CompositeActivity
        System.Workflow.Activities.SequenceActivity
           Derived Classes
Thread Safety

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

Windows 98, Windows Server 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

Version Information

.NET Framework

Supported in: 3.0
See Also

Tag :


Page view tracker