Partager via


Parallel Constructeur

Définition

Crée une instance de l'activité Parallel.

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

Exemples

L'exemple de code suivant montre comment créer une activité Parallel.

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

S’applique à