Partager via


CodeCondition.Condition Événement

Définition

Se produit lorsque la condition est évaluée.

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) 

Type d'événement

Exemples

Le code suivant montre comment joindre un gestionnaire d'événements Condition pour l'instance CodeCondition actuelle. Cet exemple de code fait partie de l'exemple du Kit de développement logiciel ConditionedActivityGroup (SDK) qui provient du fichier SimpleCAGWorkflow.designer.cs. Pour plus d’informations, consultez Utilisation de 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

S’applique à