SequenceActivity 类
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
注意
The System.Workflow.* types are deprecated. Instead, please use the new types from System.Activities.*
根据单个定义的排序运行一组子活动。
public ref class SequenceActivity : System::Workflow::ComponentModel::CompositeActivity, System::Workflow::ComponentModel::IActivityEventListener<System::Workflow::ComponentModel::ActivityExecutionStatusChangedEventArgs ^>
[System.Drawing.ToolboxBitmap(typeof(System.Workflow.Activities.SequenceActivity), "Resources.Sequence.png")]
public class SequenceActivity : System.Workflow.ComponentModel.CompositeActivity, System.Workflow.ComponentModel.IActivityEventListener<System.Workflow.ComponentModel.ActivityExecutionStatusChangedEventArgs>
[System.Drawing.ToolboxBitmap(typeof(System.Workflow.Activities.SequenceActivity), "Resources.Sequence.png")]
[System.Obsolete("The System.Workflow.* types are deprecated. Instead, please use the new types from System.Activities.*")]
public class SequenceActivity : System.Workflow.ComponentModel.CompositeActivity, System.Workflow.ComponentModel.IActivityEventListener<System.Workflow.ComponentModel.ActivityExecutionStatusChangedEventArgs>
[<System.Drawing.ToolboxBitmap(typeof(System.Workflow.Activities.SequenceActivity), "Resources.Sequence.png")>]
type SequenceActivity = class
inherit CompositeActivity
interface IActivityEventListener<ActivityExecutionStatusChangedEventArgs>
[<System.Drawing.ToolboxBitmap(typeof(System.Workflow.Activities.SequenceActivity), "Resources.Sequence.png")>]
[<System.Obsolete("The System.Workflow.* types are deprecated. Instead, please use the new types from System.Activities.*")>]
type SequenceActivity = class
inherit CompositeActivity
interface IActivityEventListener<ActivityExecutionStatusChangedEventArgs>
Public Class SequenceActivity
Inherits CompositeActivity
Implements IActivityEventListener(Of ActivityExecutionStatusChangedEventArgs)
- 继承
- 派生
- 属性
- 实现
示例
下面的代码示例演示如何创建 SequenceActivity 类的新实例,并将 SequenceActivity 类添加到 ParallelActivity 类。 此代码示例是 WhileAndParallelWorkflow.Designer.cs 文件中 WhileAndParallel SDK 示例的一部分。 有关详细信息,请参阅 使用 While 和 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";
Me.WhileLoop = New System.Workflow.Activities.WhileActivity()
Me.Parallel = New System.Workflow.Activities.ParallelActivity()
Me.Sequence1 = New System.Workflow.Activities.SequenceActivity()
Me.Sequence2 = New System.Workflow.Activities.SequenceActivity()
Me.ConsoleMessage1 = New System.Workflow.Activities.CodeActivity()
Me.ConsoleMessage2 = New System.Workflow.Activities.CodeActivity()
'
' WhileLoop
'
Me.WhileLoop.Activities.Add(Me.Parallel)
AddHandler codecondition1.Condition, AddressOf Me.WhileCondition
Me.WhileLoop.Condition = codecondition1
Me.WhileLoop.Name = "WhileLoop"
'
' Parallel
'
Me.Parallel.Activities.Add(Me.Sequence1)
Me.Parallel.Activities.Add(Me.Sequence2)
Me.Parallel.Name = "Parallel"
注解
注意
此材料讨论已过时的类型和命名空间。 有关详细信息,请参阅 Windows Workflow Foundation 4.5中
SequenceActivity 是一种 CompositeActivity,这意味着 SequenceActivity 可以包含其他活动。
SequenceActivity 类以有序方式协调一组子活动的运行,一次一个。 完成最终子活动后,将完成 SequenceActivity。
派生自 SequenceActivity 的类不应实现 IActivityEventListener<T> 接口,否则派生类将无法正确执行。
构造函数
SequenceActivity() |
已过时.
初始化 SequenceActivity 类的新实例。 |
SequenceActivity(String) |
已过时.
使用活动的名称初始化 SequenceActivity 类的新实例。 |
属性
方法
事件
Canceling |
已过时.
取消活动执行时发生。 (继承自 Activity) |
Closed |
已过时.
当 Activity 完成执行时发生。 (继承自 Activity) |
Compensating |
已过时.
在 Activity上运行补偿方法时发生。 (继承自 Activity) |
Executing |
已过时.
运行 Activity 时发生。 (继承自 Activity) |
Faulting |
已过时.
在实例运行期间引发异常时发生。 (继承自 Activity) |
StatusChanged |
已过时.
当正在运行的 Activity 的 ActivityExecutionStatus 发生更改时发生。 (继承自 Activity) |
显式接口实现
IActivityEventListener<ActivityExecutionStatusChangedEventArgs>.OnEvent(Object, ActivityExecutionStatusChangedEventArgs) |
已过时.
定义订阅事件发生时的处理过程。 |
IComponent.Disposed |
已过时.
表示处理组件的 Disposed 事件的方法。 (继承自 DependencyObject) |
适用于
另请参阅
- 使用序列活动