Share via


FlowSwitch<T>.Cases 属性

定义

获取由 FlowSwitch<T> 元素处理的事例的字典。

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)

属性值

事例的集合。

示例

下面的代码示例演示如何设置 FlowSwitch<T> 节点的 Cases 属性。 此示例摘自 使用 TryCatch 的流程图活动中的错误处理 示例。

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

注解

该字典中的每个元素都由 FlowSwitch<T> 中指定的泛型类型对象及要执行的对应 FlowNode 组成。

适用于