Conditionally runs one of two or more activities of type IfElseBranchActivity. This class cannot be inherited.
Assembly: System.Workflow.Activities (in System.Workflow.Activities.dll)
[ToolboxBitmapAttribute(typeof(IfElseActivity), "Resources.Decision.png")] [ObsoleteAttribute("The System.Workflow.* types are deprecated. Instead, please use the new types from System.Activities.*")] public sealed class IfElseActivity : CompositeActivity, IActivityEventListener<ActivityExecutionStatusChangedEventArgs>
Gets the value that indicates whether this instance is in design or run-time mode.(Inherited from DependencyObject.)
Gets or sets a value that indicates whether this instance is enabled for execution and validation.(Inherited from Activity.)
Gets or sets the name of this instance. This name must conform to the variable naming convention of the programming language that is being used in the Workflow project.(Inherited from Activity.)
Gets the qualified name of the activity. Qualified activity names are always unique in a workflow instance.(Inherited from Activity.)
Occurs when the activity execution is canceled. (Inherited from Activity.)
Occurs when an exception is raised during the running of the instance.(Inherited from Activity.)
Represents the method that handles the Disposed event of a component.(Inherited from DependencyObject.)
Defines the processing procedure when a change the activity execution status occurs.
This material discusses types and namespaces that are obsolete. For more information, see Deprecated Types in Windows Workflow Foundation 4.5.
This activity provides semantics similar to two If-ElseIf statements.
IfElseBranchActivity classes and runs the first branch when the condition evaluates to true. The final branch is not required to have a condition, in which case it always evaluates to true.contains an ordered set of
Acan complete without having run any child activity, if no conditions are satisfied.
The following code example shows how to create a new instance of the IfElseBranchActivity classes to it. This code example is part of the SequentialWorkflowWithParameters SDK Sample from the SequentialWorkflow.cs file. For more information, seeSequential Workflow With Parameters.class and add two
this.CanModifyActivities = true; System.Workflow.Activities.CodeCondition codecondition1 = new System.Workflow.Activities.CodeCondition(); this.ifElseActivity = new System.Workflow.Activities.IfElseActivity(); this.approveIfElseBranch = new System.Workflow.Activities.IfElseBranchActivity(); this.rejecteIfElseBranch = new System.Workflow.Activities.IfElseBranchActivity(); this.approve = new System.Workflow.Activities.CodeActivity(); this.reject = new System.Workflow.Activities.CodeActivity(); // // ifElseActivity // this.ifElseActivity.Activities.Add(this.approveIfElseBranch); this.ifElseActivity.Activities.Add(this.rejecteIfElseBranch); this.ifElseActivity.Name = "ifElseActivity";
Available since 3.0
Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.