ForEach<T>.Values 属性

定义

活动的输入集合,用于执行 Body 活动操作。

public:
 property System::Activities::InArgument<System::Collections::Generic::IEnumerable<T> ^> ^ Values { System::Activities::InArgument<System::Collections::Generic::IEnumerable<T> ^> ^ get(); void set(System::Activities::InArgument<System::Collections::Generic::IEnumerable<T> ^> ^ value); };
[System.Activities.RequiredArgument]
public System.Activities.InArgument<System.Collections.Generic.IEnumerable<T>> Values { get; set; }
[<System.Activities.RequiredArgument>]
member this.Values : System.Activities.InArgument<seq<'T>> with get, set
Public Property Values As InArgument(Of IEnumerable(Of T))

属性值

值的集合。

属性

示例

下面的代码示例演示如何设置 ForEach<T> 活动的 Values 属性。

new ForEach<int>
{
    Values =  new ArgumentValue<IEnumerable<int>> { ArgumentName = "Numbers" },
    Body = new ActivityAction<int>
    {
        Argument = iterationVariable,
        Handler = new Assign<int>
        {
            To = accumulator,
            Value = new InArgument<int>(env => iterationVariable.Get(env) +  accumulator.Get(env))
        }
    }
},

适用于