Aracılığıyla paylaş


CodeCondition.Condition Olay

Tanım

Koşul değerlendirildiğinde gerçekleşir.

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) 

Olay Türü

Örnekler

Aşağıdaki kod, geçerli CodeCondition örnek için bir Condition olay işleyicisinin nasıl ek yapılacağını gösterir. Bu kod örneği, SimpleCAGWorkflow.designer.cs dosyasındaki ConditionedActivityGroup SDK örneğinin bir parçasıdır. Daha fazla bilgi için bkz. ConditionedActivityGroup Kullanma.

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

Şunlara uygulanır