Επεξεργασία

Κοινή χρήση μέσω


FlowSwitch<T>.Cases Property

Definition

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

public:
 property System::Collections::Generic::IDictionary<T, System::Activities::Statements::FlowNode ^> ^ Cases { System::Collections::Generic::IDictionary<T, System::Activities::Statements::FlowNode ^> ^ get(); };
public System.Collections.Generic.IDictionary<T,System.Activities.Statements.FlowNode> Cases { get; }
member this.Cases : System.Collections.Generic.IDictionary<'T, System.Activities.Statements.FlowNode>
Public ReadOnly Property Cases As IDictionary(Of T, FlowNode)

Property Value

The collection of cases.

Examples

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
};

Remarks

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

Applies to