FlowSwitch<T>.Default 屬性

定義

FlowNode 集合中的項目沒有符合 Cases 的評估結果時,所要執行的 Expression

public:
 property System::Activities::Statements::FlowNode ^ Default { System::Activities::Statements::FlowNode ^ get(); void set(System::Activities::Statements::FlowNode ^ value); };
public System.Activities.Statements.FlowNode Default { get; set; }
member this.Default : System.Activities.Statements.FlowNode with get, set
Public Property Default As FlowNode

屬性值

要執行的預設 FlowNode

範例

下列程式碼範例將示範如何設定 FlowSwitch<T> 節點的 Default 屬性。 此範例來自 使用 TryCatch 的流程圖活動中的錯誤處理 範例。

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

適用於