FlowSwitch<T>.Cases 屬性
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
取得一個由元素處理 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 執行的物件組成。