FlowSwitch<T> Constructor ()

.NET Framework (current version)
 

Creates a new instance of the FlowSwitch<T> class.

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

public FlowSwitch()

The following code sample demonstrates creating 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: