FlowSwitch<T>.Cases Property

.NET Framework (current version)
 

Gets a dictionary of cases to be processed by the FlowSwitch<T> element.

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

public IDictionary<T, FlowNode> Cases { get; }

Property Value

Type: System.Collections.Generic.IDictionary<T, FlowNode>

The collection of cases.

Each element in the dictionary consists of an object of the generic type specified in FlowSwitch<T> and a corresponding FlowNode to execute.

The following code sample demonstrates setting the Cases 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: