While Constructores

Definición

Crea una nueva instancia de la actividad de la clase While.Creates a new instance of the While activity.

Sobrecargas

While()

Crea una nueva instancia de la actividad de la clase While.Creates a new instance of the While activity.

While(Activity<Boolean>)

Crea una nueva instancia de la actividad de la clase While.Creates a new instance of the While activity.

While(Expression<Func<ActivityContext,Boolean>>)

Crea una nueva instancia de la actividad de la clase While.Creates a new instance of the While activity.

Ejemplos

En el siguiente ejemplo de código se muestra la creación de una actividad de la clase While.The following code sample demonstrates creating a While activity. Este ejemplo procede del ejemplo de correlación basada en contenido .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
    }
},

While()

Crea una nueva instancia de la actividad de la clase While.Creates a new instance of the While activity.

public:
 While();
public While ();
Public Sub New ()

Ejemplos

En el siguiente ejemplo de código se muestra la creación de una actividad de la clase While.The following code sample demonstrates creating a While activity. Este ejemplo procede del ejemplo de correlación basada en contenido .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
    }
},

While(Activity<Boolean>)

Crea una nueva instancia de la actividad de la clase While.Creates a new instance of the While activity.

public:
 While(System::Activities::Activity<bool> ^ condition);
public While (System.Activities.Activity<bool> condition);
new System.Activities.Statements.While : System.Activities.Activity<bool> -> System.Activities.Statements.While
Public Sub New (condition As Activity(Of Boolean))

Parámetros

condition
Activity<Boolean>

Condición según la que se produce la iteración de la actividad.The condition under which the activity iterates.

While(Expression<Func<ActivityContext,Boolean>>)

Crea una nueva instancia de la actividad de la clase While.Creates a new instance of the While activity.

public:
 While(System::Linq::Expressions::Expression<Func<System::Activities::ActivityContext ^, bool> ^> ^ condition);
public While (System.Linq.Expressions.Expression<Func<System.Activities.ActivityContext,bool>> condition);
new System.Activities.Statements.While : System.Linq.Expressions.Expression<Func<System.Activities.ActivityContext, bool>> -> System.Activities.Statements.While
Public Sub New (condition As Expression(Of Func(Of ActivityContext, Boolean)))

Parámetros

condition
Expression<Func<ActivityContext,Boolean>>

Condición según la que se produce la iteración de la actividad.The condition under which the activity iterates.

Se aplica a