While 類別
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
執行包含的活動,而條件評估為 true。
public ref class While sealed : System::Activities::NativeActivity
[System.Windows.Markup.ContentProperty("Body")]
public sealed class While : System.Activities.NativeActivity
[<System.Windows.Markup.ContentProperty("Body")>]
type While = class
inherit NativeActivity
Public NotInheritable Class While
Inherits NativeActivity
- 繼承
- 屬性
範例
以下程式碼範例示範建立一項 While 活動。
new While
{
Condition = true,
Body = new Receive
{
ServiceContractName = Constants.POContractName,
OperationName = Constants.UpdatePOName,
CorrelatesWith = poidHandle, // identifies that the UpdatePO operation is waiting on the PurchaseOrderId that was used to initialize this handle
CorrelatesOn = new MessageQuerySet // the query that is used on an incoming message to find the requisite PurchaseOrderId specified in the correlation
{
// Id is the name of the incoming parameter within the PurchaseOrder
{ "PoId", new XPathMessageQuery("sm:body()/defns:PurchaseOrder/defns:Id", Constants.XPathMessageContext) }
},
Content = ReceiveContent.Create(new OutArgument<PurchaseOrder>(po)) // creates a ReceiveMessageContent
}
},
建構函式
| 名稱 | Description |
|---|---|
| While() |
建立一個新的活動實例 While 。 |
| While(Activity<Boolean>) |
建立一個新的活動實例 While 。 |
| While(Expression<Func<ActivityContext,Boolean>>) |
建立一個新的活動實例 While 。 |
屬性
| 名稱 | Description |
|---|---|
| Body |
Activity在迴圈中執行 |
| CacheId |
取得在工作流程定義範圍內唯一且快取識別碼的識別碼。 (繼承來源 Activity) |
| CanInduceIdle |
取得或設定一個值,指示該活動是否會導致工作流程進入閒置狀態。 (繼承來源 NativeActivity) |
| Condition |
在每次迴圈迭Activity<TResult>代前評估。 |
| Constraints |
取得一組 Constraint 可設定以驗證 的 Activity活動集合。 (繼承來源 Activity) |
| DisplayName |
取得或設定一個可選的友善名稱,用於除錯、驗證、異常處理及追蹤。 (繼承來源 Activity) |
| Id |
取得一個在工作流程定義範圍內唯一的識別碼。 (繼承來源 Activity) |
| Implementation |
活動的執行邏輯。 (繼承來源 NativeActivity) |
| ImplementationVersion |
取得或設定活動的實作版本。 (繼承來源 NativeActivity) |
| Variables |