While.Body 屬性
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
要在 While
迴圈中執行的 Activity。
public:
property System::Activities::Activity ^ Body { System::Activities::Activity ^ get(); void set(System::Activities::Activity ^ value); };
[System.Windows.Markup.DependsOn("Condition")]
public System.Activities.Activity Body { get; set; }
[<System.Windows.Markup.DependsOn("Condition")>]
member this.Body : System.Activities.Activity with get, set
Public Property Body As Activity
屬性值
要執行的活動。
- 屬性
範例
下列程式碼範例將示範如何設定 While 活動的 Body 屬性。
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
}
},