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
    }
};

适用于