FlowSwitch<T>.Default 屬性

定義

FlowNode 集合中的項目沒有符合 Cases 的評估結果時,所要執行的 ExpressionThe FlowNode to be executed if no elements in the Cases collection match the result of the evaluation of the 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

要執行的預設 FlowNodeThe default FlowNode to execute.

範例

下列程式碼範例將示範如何設定 FlowSwitch<T> 節點的 Default 屬性。The following code sample demonstrates setting the Default property of a FlowSwitch<T> node. 此範例來自 使用 TryCatch 範例的流程圖活動中的錯誤處理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
};

適用於