ForEach<T>.Body 属性

定义

要为 ActivityAction 集合中的每一项执行的 Values

public:
 property System::Activities::ActivityAction<T> ^ Body { System::Activities::ActivityAction<T> ^ get(); void set(System::Activities::ActivityAction<T> ^ value); };
public System.Activities.ActivityAction<T> Body { get; set; }
member this.Body : System.Activities.ActivityAction<'T> with get, set
Public Property Body As ActivityAction(Of T)

属性值

要执行的操作。

示例

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

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))
        }
    }
},

适用于