FlowSwitch<T>.Default Property

.NET Framework (current version)
 

The FlowNode to be executed if no elements in the Cases collection match the result of the evaluation of the Expression.

Namespace:   System.Activities.Statements
Assembly:  System.Activities (in System.Activities.dll)

public FlowNode Default { get; set; }

Property Value

Type: System.Activities.Statements.FlowNode

The default FlowNode to execute.

The following code sample demonstrates setting the Default property of a FlowSwitch<T> node. This example is from the Fault Handling in a Flowchart Activity Using TryCatch sample.

FlowSwitch<string> promoCodeSwitch = new FlowSwitch<string>
{
    Expression = promo,
    Cases =
    {
       { "Single", singleStep },
       { "MNK", mnkStep },
       { "MWK", mwkStep }
    },
    Default = discountDefault
};

.NET Framework
Available since 4.0
Return to top
Show: