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) |
適用於
另請參閱
- 使用時序活動