Compartilhar via


CodeCondition.Condition Evento

Definição

Ocorre quando a condição é avaliada.

public:
 event EventHandler<System::Workflow::Activities::ConditionalEventArgs ^> ^ Condition;
public event EventHandler<System.Workflow.Activities.ConditionalEventArgs> Condition;
member this.Condition : EventHandler<System.Workflow.Activities.ConditionalEventArgs> 
Public Custom Event Condition As EventHandler(Of ConditionalEventArgs) 

Tipo de evento

Exemplos

O código a seguir mostra como anexar um Condition manipulador de eventos para a instância atual CodeCondition . Este exemplo de código faz parte do exemplo do SDK ConditionedActivityGroup do arquivo SimpleCAGWorkflow.designer.cs. Para obter mais informações, consulte Using ConditionedActivityGroup.

this.CanModifyActivities = true;
System.Workflow.Activities.CodeCondition codecondition1 = new System.Workflow.Activities.CodeCondition();
System.Workflow.Activities.CodeCondition codecondition2 = new System.Workflow.Activities.CodeCondition();
this.BookingCag = new System.Workflow.Activities.ConditionedActivityGroup();
this.Car = new System.Workflow.Activities.CodeActivity();
this.Airline = new System.Workflow.Activities.CodeActivity();
//
// BookingCag
//
this.BookingCag.Activities.Add(this.Car);
this.BookingCag.Activities.Add(this.Airline);
this.BookingCag.Name = "BookingCag";
codecondition1.Condition += new System.EventHandler<System.Workflow.Activities.ConditionalEventArgs>(this.CarCondition);
//
// Car
//
this.Car.Name = "Car";
this.Car.ExecuteCode += new System.EventHandler(this.Car_ExecuteCode);
this.Car.SetValue(System.Workflow.Activities.ConditionedActivityGroup.WhenConditionProperty, codecondition1);
codecondition2.Condition += new System.EventHandler<System.Workflow.Activities.ConditionalEventArgs>(this.AirlineCondition);
Me.CanModifyActivities = True
Dim codecondition1 As New System.Workflow.Activities.CodeCondition()
Dim codecondition2 As New System.Workflow.Activities.CodeCondition()
Me.BookingCag = New System.Workflow.Activities.ConditionedActivityGroup()
Me.Car = New System.Workflow.Activities.CodeActivity()
Me.Airline = New System.Workflow.Activities.CodeActivity()
' 
' BookingCag
'
Me.BookingCag.Activities.Add(Me.Car)
Me.BookingCag.Activities.Add(Me.Airline)
Me.BookingCag.Name = "BookingCag"
AddHandler codecondition1.Condition, AddressOf CarCondition
' 
' Car
' 
Me.Car.Name = "Car"
AddHandler Car.ExecuteCode, AddressOf Me.Car_ExecuteCode
Me.Car.SetValue(System.Workflow.Activities.ConditionedActivityGroup.WhenConditionProperty, codecondition1)
AddHandler codecondition2.Condition, AddressOf Me.AirlineCondition

Aplica-se a