Parallel.Branches Propriedade
Definição
Os elementos filho a serem executados em paralelo.The child elements to be executed in parallel.
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)
Valor da propriedade
Os elementos.The elements.
- Atributos
Exemplos
O exemplo de código a seguir demonstra a definição da propriedade branches de uma Parallel atividade.The following code sample demonstrates setting the Branches property of a Parallel activity. Este exemplo é do manipulador de cancelamento de exemplo de atividade Compensable .This example is from the Cancellation Handler on Compensable Activity sample.
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.." },
}
},