Parallel.Branches Свойство

Определение

Дочерние элементы, которые выполняются параллельно.

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)

Значение свойства

Элементы.

Атрибуты

Примеры

В следующем образце кода показано задание свойства Branches для действия Parallel.

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

Применяется к