Compartir a través de


CodeCondition.Condition Evento

Definición

Se produce cuando se evalúa la condición.

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

Ejemplos

El código siguiente muestra cómo asociar un controlador de eventos Condition para la instancia CodeCondition actual. Este ejemplo de código forma parte del ejemplo de SDK de ConditionedActivityGroup del archivo SimpleCAGWorkflow.designer.cs. Para obtener más información, vea 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

Se aplica a