Pick Constructor
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.
Creates a new instance of the Pick class.
public:
Pick();
public Pick ();
Public Sub New ()
Examples
The following code sample demonstrates creating a Pick 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
Collaborate with us on GitHub
The source for this content can be found on GitHub, where you can also create and review issues and pull requests. For more information, see our contributor guide.