FlowSwitch<T>.Expression Property

.NET Framework (current version)
 

The expression to evaluate against the collection of Cases.

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

public Activity<T> Expression { get; set; }

Property Value

Type: System.Activities.Activity<T>

The expression to evaluate.

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