Parallel.Branches 屬性
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
要平行執行的子項目。
public:
property System::Collections::ObjectModel::Collection<System::Activities::Activity ^> ^ Branches { System::Collections::ObjectModel::Collection<System::Activities::Activity ^> ^ get(); };
[System.Windows.Markup.DependsOn("CompletionCondition")]
public System.Collections.ObjectModel.Collection<System.Activities.Activity> Branches { get; }
[<System.Windows.Markup.DependsOn("CompletionCondition")>]
member this.Branches : System.Collections.ObjectModel.Collection<System.Activities.Activity>
Public ReadOnly Property Branches As Collection(Of Activity)
屬性值
項目。
- 屬性
範例
下列程式碼範例將示範如何設定 Parallel 活動的 Branches 屬性。
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.." },
}
},