初始化 Windows Workflow Foundation 的預設機制為使用 WorkflowRuntime 類別,如下所示:
Imports System
Imports System.Threading
Imports System.Workflow.Runtime
Imports System.Workflow.Runtime.Hosting
Class Program
Shared Sub Main()
Using workflowRuntime As WorkflowRuntime = New WorkflowRuntime()
End Using
End Sub
End Class
using System;
using System.Threading;
using System.Workflow.Runtime;
using System.Workflow.Runtime.Hosting;
class Program
{
static void Main(string[] args)
{
using (WorkflowRuntime workflowRuntime = new WorkflowRuntime())
{
}
}
}
在 using 陳述式主體中,WorkflowRuntime 物件已初始化並隨時可以使用。此時,您可以建立事件處理常式來處理由執行階段引擎引發的事件、擷取並設定任何由執行階段引擎使用的基底服務,最後建立並啟動工作流程執行個體。如需 Windows Workflow Foundation 服務的詳細資訊,請參閱 Windows Workflow Foundation 服務。
請參閱
概念
Copyright © 2007 by Microsoft Corporation.All rights reserved.