Parallel.CompletionCondition Property
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Evaluates after any branch completes.
public:
property System::Activities::Activity<bool> ^ CompletionCondition { System::Activities::Activity<bool> ^ get(); void set(System::Activities::Activity<bool> ^ value); };
[System.Windows.Markup.DependsOn("Variables")]
public System.Activities.Activity<bool> CompletionCondition { get; set; }
[<System.Windows.Markup.DependsOn("Variables")>]
member this.CompletionCondition : System.Activities.Activity<bool> with get, set
Public Property CompletionCondition As Activity(Of Boolean)
The completion expression.
- Attributes
The following code sample demonstrates setting the CompletionCondition property of a Parallel activity.
return new Parallel
{
// Timeout from branch causes other branch to cancel.
CompletionCondition = true,
Branches =
{
// Delay Branch
new Sequence
{
Activities =
{
new WriteLine { Text = "Branch1: Body is about to Delay 2secs transferring execution to Branch2" },
new Delay
{
Duration = TimeSpan.FromSeconds(2)
},
new WriteLine { Text = "Branch1: Body is about to complete causing Branch2 to cancel.." },
}
},
If this property evaluates to true
, then the other scheduled elements in the Branches collection are canceled. If this property is not set, all Activity objects in the Branches collection execute until completion.
Proizvod | Verzije |
---|---|
.NET Framework | 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1 |
.NET povratne informacije
.NET je projekat otvorenog koda. Odaberite vezu za pružanje povratnih informacija: