Export (0) Print
Expand All

While.Body Property

The Activity to execute in the While loop.

Namespace:  System.Activities.Statements
Assembly:  System.Activities (in System.Activities.dll)

public Activity Body { get; set; }

Property Value

Type: System.Activities.Activity
The activit to execute.

The following code sample demonstrates setting the Body property of a While activity. This example is from the Content-Based Correlation sample.

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

.NET Framework

Supported in: 4.5, 4

.NET Framework Client Profile

Supported in: 4

Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Show:
© 2014 Microsoft