PickBranch.Action Property
Definition
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.
The Activity to execute if this branch is triggered for execution.
public:
property System::Activities::Activity ^ Action { System::Activities::Activity ^ get(); void set(System::Activities::Activity ^ value); };
[System.Windows.Markup.DependsOn("Trigger")]
public System.Activities.Activity Action { get; set; }
[<System.Windows.Markup.DependsOn("Trigger")>]
member this.Action : System.Activities.Activity with get, set
Public Property Action As Activity
Property Value
The activity to execute.
- Attributes
Examples
The following code sample demonstrates setting the Action property of a PickBranch activity. This example is from the Using the Pick Activity sample.
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;
}
Applies to
ทํางานร่วมกับเราใน GitHub
แหล่งที่มาสำหรับเนื้อหานี้สามารถพบได้บน GitHub ซึ่งคุณยังสามารถสร้างและตรวจสอบปัญหาและคำขอดึงข้อมูลได้ สำหรับข้อมูลเพิ่มเติม ให้ดูคู่มือผู้สนับสนุนของเรา