创建 WorkflowRuntime

用于初始化 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 服务

另请参见

概念

处理 WorkflowRuntime 事件
运行工作流

版权所有 (C) 2007 Microsoft Corporation。保留所有权利。