다음을 통해 공유


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)

속성 값

요소입니다.

특성

예제

다음 코드 샘플에서는 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.." },
            }
        },

적용 대상