Freigeben über


Parallel.Branches Eigenschaft

Definition

Die untergeordneten Elemente, die parallel ausgeführt werden sollen.

public:
 property System::Collections::ObjectModel::Collection<System::Activities::Activity ^> ^ Branches { System::Collections::ObjectModel::Collection<System::Activities::Activity ^> ^ get(); };
[System.Windows.Markup.DependsOn("CompletionCondition")]
public System.Collections.ObjectModel.Collection<System.Activities.Activity> Branches { get; }
[<System.Windows.Markup.DependsOn("CompletionCondition")>]
member this.Branches : System.Collections.ObjectModel.Collection<System.Activities.Activity>
Public ReadOnly Property Branches As Collection(Of Activity)

Eigenschaftswert

Die Elemente.

Attribute

Beispiele

Im folgenden Codebeispiel wird das Festlegen der „Branches“-Eigenschaft einer Parallel-Aktivität gezeigt.

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.." },
            }
        },

Gilt für: