WhileActivity.Condition Property


Gets or sets a condition that determines whether the WhileActivity should run or finish.

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

public ActivityCondition Condition { get; set; }

Property Value

Type: System.Workflow.ComponentModel.ActivityCondition

When the RuleCondition property evaluates to true, the WhileActivity continues to run. When the RuleCondition evaluates to false, the WhileActivity finishes.

The following code example demonstrates how to create a new instance of the WhileActivity class, add the ParallelActivity class to the WhileActivity class, and set the Condition property. This code example is part of the WhileAndParallel SDK Sample from the WhileAndParallelWorkflow.Designer.cs file. For more information, see Using While and Parallel.

workflowRuntime.WorkflowUnloaded += OnWorkflowUnload;

.NET Framework
Available since 3.0

WhileActivity Class
System.Workflow.Activities Namespace
Using the While Activity
Using Conditions in Workflows

Return to top