WorkflowInstance.WorkflowRuntime 属性

定义

获取此工作流实例的 WorkflowRuntime

public:
 property System::Workflow::Runtime::WorkflowRuntime ^ WorkflowRuntime { System::Workflow::Runtime::WorkflowRuntime ^ get(); };
public System.Workflow.Runtime.WorkflowRuntime WorkflowRuntime { get; }
member this.WorkflowRuntime : System.Workflow.Runtime.WorkflowRuntime
Public ReadOnly Property WorkflowRuntime As WorkflowRuntime

属性值

WorkflowRuntime

一个 WorkflowRuntime,表示此工作流实例在其中运行的执行环境。

示例

下面的示例演示如何访问 WorkflowRuntime 对象的正在执行的 WorkflowInstance

// Create the main workflow runtime
WorkflowRuntime runtime = new WorkflowRuntime();
// Create a workflow instance
WorkflowInstance workflowInstance = runtime.CreateWorkflow(typeof(Workflow1));
// Obtain a reference to the instance's parent runtime
WorkflowRuntime runtime2 = workflowInstance.WorkflowRuntime;
' Create the main workflow runtime
Dim runtime As New WorkflowRuntime()
' Create a workflow instance
Dim workflowInstance As WorkflowInstance = runtime.CreateWorkflow(GetType(Workflow1))
' Obtain a reference to the instance's parent runtime
Dim runtime2 As WorkflowRuntime = workflowInstance.WorkflowRuntime

适用于