Parallel Constructor

Definición

Crea una nueva instancia de la Parallel actividad.

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

Ejemplos

En el ejemplo de código siguiente se muestra cómo crear una Parallel actividad.

return new Parallel
{
    // Timeout from branch causes other branch to cancel.
    CompletionCondition = true,

    Branches =
    {
        // Delay Branch
        new Sequence
        {
            Activities =
            {
                new WriteLine { Text = "Branch1: Body is about to Delay 2secs transferring execution to Branch2" },
                new Delay
                {
                    Duration = TimeSpan.FromSeconds(2)
                },
                new WriteLine { Text = "Branch1: Body is about to complete causing Branch2 to cancel.." },
            }
        },

Se aplica a