Delay Constructor ()
.NET Framework (current version)
Creates a new instance of the Delay activity.
Assembly: System.Activities (in System.Activities.dll)
The following code sample demonstrates creating a Delay activity. This example is from the Using the Pick Activitysample.
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; }
.NET Framework
Available since 4.0
Available since 4.0
Show: