共用方式為


Flowchart.Variables 屬性

定義

取得或設定與 Variable 相關聯的 Flowchart 物件集合,可在流程圖所包含的各子活動之間共用狀態。

public:
 property System::Collections::ObjectModel::Collection<System::Activities::Variable ^> ^ Variables { System::Collections::ObjectModel::Collection<System::Activities::Variable ^> ^ get(); };
public System.Collections.ObjectModel.Collection<System.Activities.Variable> Variables { get; }
member this.Variables : System.Collections.ObjectModel.Collection<System.Activities.Variable>
Public ReadOnly Property Variables As Collection(Of Variable)

屬性值

變數集合。

範例

下列程式碼範例將示範如何在 Flowchart 活動中使用 Variables。 此範例來自 使用 TryCatch 的流程圖活動中的錯誤處理 範例。

Flowchart flowChart = new Flowchart
{
    DisplayName = "Promotional Discount Calculation",
    Variables = {discount, promo, numberOfKids},
    StartNode = promoCodeSwitch,
    Nodes =
    {
        promoCodeSwitch,
        singleStep,
        mnkStep,
        mwkStep,
        discountDefault,
        flowDecision,
        discountApplied,
        discountNotApplied
    }
};

適用於