Share via


Pick.Branches 속성

정의

들어오는 이벤트를 기준으로 PickBranch 활동이 잠재적으로 하나를 실행하는 Pick 개체의 컬렉션입니다.

public:
 property System::Collections::ObjectModel::Collection<System::Activities::Statements::PickBranch ^> ^ Branches { System::Collections::ObjectModel::Collection<System::Activities::Statements::PickBranch ^> ^ get(); };
public System.Collections.ObjectModel.Collection<System.Activities.Statements.PickBranch> Branches { get; }
member this.Branches : System.Collections.ObjectModel.Collection<System.Activities.Statements.PickBranch>
Public ReadOnly Property Branches As Collection(Of PickBranch)

속성 값

분기 컬렉션입니다.

예제

다음 코드 샘플에서는 Pick 활동의 분기 속성을 설정하는 방법을 보여 줍니다. 이 예제에서는 합니다 Pick 활동을 사용 하 여 샘플입니다.

static Activity CreateWF()
{
    Variable<string> name = new Variable<string>();
    Sequence body = new Sequence
    {
        Variables = { name },
        Activities =
        {
            new WriteLine { Text = "What is your name? (You have 5 seconds to answer)" },
            new Pick
            {
               Branches =
               {
                   new PickBranch
                    {
                       Trigger = new ReadString
                       {
                           Result = name,
                           BookmarkName = bookmarkName
                       },
                       Action = new WriteLine
                       {
                           Text = new InArgument<string>(env => "Hello " + name.Get(env))
                       }
                   },
                   new PickBranch
                    {
                       Trigger = new Delay
                       {
                           Duration = TimeSpan.FromSeconds(5)
                       },
                       Action = new WriteLine
                       {
                           Text = "Time is up."
                       }
                   }
               }
           }
       }
    };

    return body;
}

적용 대상