Export (0) Print
Expand All

WorkflowRuntime.GetLoadedWorkflows Method

Gets a collection that contains all the workflow instances currently loaded in memory.

Namespace:  System.Workflow.Runtime
Assembly:  System.Workflow.Runtime (in System.Workflow.Runtime.dll)

public ReadOnlyCollection<WorkflowInstance> GetLoadedWorkflows()

Return Value

Type: System.Collections.ObjectModel.ReadOnlyCollection<WorkflowInstance>
A WorkflowInstance object for each workflow instance currently loaded in memory.


The WorkflowRuntime is disposed.

Note that, unlike GetWorkflow, this method does not throw a InvalidOperationException if the runtime is not started.

The following example demonstrates how to retrieve a collection of loaded workflows from a WorkflowRuntime object.

// Create a new workflow runtime
WorkflowRuntime workflowRuntime = new WorkflowRuntime();
// Start the runtime
// Create a collection of workflow instances
ReadOnlyCollection<WorkflowInstance> workflows;
// Populate the collection of workflow instances
workflows = workflowRuntime.GetLoadedWorkflows();

.NET Framework

Supported in: 4.6, 4.5, 4, 3.5, 3.0
© 2015 Microsoft