Parallel Konstruktor

Definition

Erstellt eine neue Instanz der Parallel-Aktivität.

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

Beispiele

Im folgenden Codebeispiel wird das Erstellen einer Parallel-Aktivität gezeigt.

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

Gilt für: