Delay 類別
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
使用 TimerExtension一個 。
public ref class Delay sealed : System::Activities::NativeActivity
[System.Windows.Markup.ContentProperty("Duration")]
public sealed class Delay : System.Activities.NativeActivity
[<System.Windows.Markup.ContentProperty("Duration")>]
type Delay = class
inherit NativeActivity
Public NotInheritable Class Delay
Inherits NativeActivity
- 繼承
- 屬性
範例
以下程式碼範例示範建立一項 Delay 活動。 這個範例來自《 Using the Pick Activity 》範例。
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;
}
備註
當活動的計時器結束時,該 Delay 活動完成執行。
建構函式
| 名稱 | Description |
|---|---|
| Delay() |
建立一個新的活動實例 Delay 。 |
屬性
| 名稱 | Description |
|---|---|
| CacheId |
取得在工作流程定義範圍內唯一且快取識別碼的識別碼。 (繼承來源 Activity) |
| CanInduceIdle |
取得或設定一個值,指示該活動是否會導致工作流程進入閒置狀態。 (繼承來源 NativeActivity) |
| Constraints |
取得一組 Constraint 可設定以驗證 的 Activity活動集合。 (繼承來源 Activity) |
| DisplayName |
取得或設定一個可選的友善名稱,用於除錯、驗證、異常處理及追蹤。 (繼承來源 Activity) |
| Duration | |
| Id |
取得一個在工作流程定義範圍內唯一的識別碼。 (繼承來源 Activity) |
| Implementation |
活動的執行邏輯。 (繼承來源 NativeActivity) |
| ImplementationVersion |
取得或設定活動的實作版本。 (繼承來源 NativeActivity) |