共用方式為


While.Condition 屬性

定義

While 迴圈的每個反覆項目之前評估的 Activity<TResult>

public:
 property System::Activities::Activity<bool> ^ Condition { System::Activities::Activity<bool> ^ get(); void set(System::Activities::Activity<bool> ^ value); };
[System.Windows.Markup.DependsOn("Variables")]
public System.Activities.Activity<bool> Condition { get; set; }
[<System.Windows.Markup.DependsOn("Variables")>]
member this.Condition : System.Activities.Activity<bool> with get, set
Public Property Condition As Activity(Of Boolean)

屬性值

條件。

屬性

範例

下列程式碼範例將示範如何設定 While 活動的 Condition 屬性。

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
    }
},

適用於