Delay.Duration 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.
public:
property System::Activities::InArgument<TimeSpan> ^ Duration { System::Activities::InArgument<TimeSpan> ^ get(); void set(System::Activities::InArgument<TimeSpan> ^ value); };
[System.Activities.RequiredArgument]
public System.Activities.InArgument<TimeSpan> Duration { get; set; }
[<System.Activities.RequiredArgument>]
member this.Duration : System.Activities.InArgument<TimeSpan> with get, set
Public Property Duration As InArgument(Of TimeSpan)
Property Value
The timer duration.
- Attributes
Examples
The following code sample demonstrates using Duration in a Delay 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 पर पाया जा सकता है, जहाँ आप समस्याएँ बना और समीक्षा भी कर सकते हैं और अनुरोध खींच सकते हैं. अधिक जानकारी के लिए, हमारे योगदानकर्ता गाइड देखें.