Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
228 lines (215 sloc) 14.9 KB
<Type Name="ForEach&lt;T&gt;" FullName="System.Activities.Statements.ForEach&lt;T&gt;">
<TypeSignature Language="C#" Value="public sealed class ForEach&lt;T&gt; : System.Activities.NativeActivity" />
<TypeSignature Language="ILAsm" Value=".class public auto ansi sealed beforefieldinit ForEach`1&lt;T&gt; extends System.Activities.NativeActivity" />
<TypeSignature Language="DocId" Value="T:System.Activities.Statements.ForEach`1" />
<TypeSignature Language="VB.NET" Value="Public NotInheritable Class ForEach(Of T)&#xA;Inherits NativeActivity" />
<TypeSignature Language="C++ CLI" Value="generic &lt;typename T&gt;&#xA;public ref class ForEach sealed : System::Activities::NativeActivity" />
<TypeSignature Language="F#" Value="type ForEach&lt;'T&gt; = class&#xA; inherit NativeActivity" />
<AssemblyInfo>
<AssemblyName>System.Activities</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<TypeParameters>
<TypeParameter Name="T" />
</TypeParameters>
<Base>
<BaseTypeName>System.Activities.NativeActivity</BaseTypeName>
</Base>
<Interfaces />
<Attributes>
<Attribute>
<AttributeName>System.Windows.Markup.ContentProperty("Body")</AttributeName>
</Attribute>
</Attributes>
<Docs>
<typeparam name="T">The type of the values provided in the <see cref="P:System.Activities.Statements.ForEach`1.Values" /> collection.</typeparam>
<summary>Executes an activity action once for each value provided in the <see cref="P:System.Activities.Statements.ForEach`1.Values" /> collection.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
<xref:System.Activities.Statements.ForEach`1> is similar to the keyword `foreach` but is implemented as an activity rather than a language statement. Note that unlike `foreach` in C#, the <xref:System.Activities.Statements.ForEach%601> activity uses <xref:System.Collections.Generic.IEnumerable%601.GetEnumerator%2A>, rather than <xref:System.Collections.Generic.IEnumerator%601>.
## Examples
The following code sample demonstrates creating a <xref:System.Activities.Statements.ForEach%601> activity. This example is from the [DynamicActivity Creation](~/docs/framework/windows-workflow-foundation/samples/dynamicactivity-creation.md) sample.
[!code-csharp[wfs_DynamicActivityCreation#1](~/samples/snippets/csharp/VS_Snippets_CFX/wfs_dynamicactivitycreation/cs/program.cs#1)]
]]></format>
</remarks>
</Docs>
<Members>
<Member MemberName=".ctor">
<MemberSignature Language="C#" Value="public ForEach ();" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor() cil managed" />
<MemberSignature Language="DocId" Value="M:System.Activities.Statements.ForEach`1.#ctor" />
<MemberSignature Language="VB.NET" Value="Public Sub New ()" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; ForEach();" />
<MemberType>Constructor</MemberType>
<AssemblyInfo>
<AssemblyName>System.Activities</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Parameters />
<Docs>
<summary>Creates a new instance of the <see cref="T:System.Activities.Statements.ForEach`1" /> class.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Examples
The following code sample demonstrates creating a <xref:System.Activities.Statements.ForEach%601> activity. This example is from the [DynamicActivity Creation](~/docs/framework/windows-workflow-foundation/samples/dynamicactivity-creation.md) sample.
[!code-csharp[wfs_DynamicActivityCreation#1](~/samples/snippets/csharp/VS_Snippets_CFX/wfs_dynamicactivitycreation/cs/program.cs#1)]
]]></format>
</remarks>
</Docs>
</Member>
<Member MemberName="Body">
<MemberSignature Language="C#" Value="public System.Activities.ActivityAction&lt;T&gt; Body { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property instance class System.Activities.ActivityAction`1&lt;!T&gt; Body" />
<MemberSignature Language="DocId" Value="P:System.Activities.Statements.ForEach`1.Body" />
<MemberSignature Language="VB.NET" Value="Public Property Body As ActivityAction(Of T)" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; property System::Activities::ActivityAction&lt;T&gt; ^ Body { System::Activities::ActivityAction&lt;T&gt; ^ get(); void set(System::Activities::ActivityAction&lt;T&gt; ^ value); };" />
<MemberSignature Language="F#" Value="member this.Body : System.Activities.ActivityAction&lt;'T&gt; with get, set" Usage="System.Activities.Statements.ForEach&lt;'T&gt;.Body" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Activities</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute>
<AttributeName>System.ComponentModel.DefaultValue(null)</AttributeName>
</Attribute>
<Attribute FrameworkAlternate="netframework-4.0">
<AttributeName>get: System.Runtime.TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")</AttributeName>
</Attribute>
<Attribute FrameworkAlternate="netframework-4.0">
<AttributeName>set: System.Runtime.TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Activities.ActivityAction&lt;T&gt;</ReturnType>
</ReturnValue>
<Docs>
<summary>The <see cref="T:System.Activities.ActivityAction" /> to be executed for each item in the <see cref="P:System.Activities.Statements.ForEach`1.Values" /> collection.</summary>
<value>The action to be executed.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Examples
The following code sample demonstrates setting the Body property of a <xref:System.Activities.Statements.ForEach%601> activity. This example is from the [DynamicActivity Creation](~/docs/framework/windows-workflow-foundation/samples/dynamicactivity-creation.md) sample.
[!code-csharp[wfs_DynamicActivityCreation#1](~/samples/snippets/csharp/VS_Snippets_CFX/wfs_dynamicactivitycreation/cs/program.cs#1)]
]]></format>
</remarks>
</Docs>
</Member>
<Member MemberName="CacheMetadata">
<MemberSignature Language="C#" Value="protected override void CacheMetadata (System.Activities.NativeActivityMetadata metadata);" />
<MemberSignature Language="ILAsm" Value=".method familyhidebysig virtual instance void CacheMetadata(valuetype System.Activities.NativeActivityMetadata metadata) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Activities.Statements.ForEach`1.CacheMetadata(System.Activities.NativeActivityMetadata)" />
<MemberSignature Language="VB.NET" Value="Protected Overrides Sub CacheMetadata (metadata As NativeActivityMetadata)" />
<MemberSignature Language="C++ CLI" Value="protected:&#xA; override void CacheMetadata(System::Activities::NativeActivityMetadata metadata);" />
<MemberSignature Language="F#" Value="override this.CacheMetadata : System.Activities.NativeActivityMetadata -&gt; unit" Usage="forEach.CacheMetadata metadata" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Activities</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="metadata" Type="System.Activities.NativeActivityMetadata" />
</Parameters>
<Docs>
<param name="metadata">To be added.</param>
<summary>To be added.</summary>
<remarks>To be added.</remarks>
</Docs>
</Member>
<Member MemberName="Execute">
<MemberSignature Language="C#" Value="protected override void Execute (System.Activities.NativeActivityContext context);" />
<MemberSignature Language="ILAsm" Value=".method familyhidebysig virtual instance void Execute(class System.Activities.NativeActivityContext context) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Activities.Statements.ForEach`1.Execute(System.Activities.NativeActivityContext)" />
<MemberSignature Language="VB.NET" Value="Protected Overrides Sub Execute (context As NativeActivityContext)" />
<MemberSignature Language="C++ CLI" Value="protected:&#xA; override void Execute(System::Activities::NativeActivityContext ^ context);" />
<MemberSignature Language="F#" Value="override this.Execute : System.Activities.NativeActivityContext -&gt; unit" Usage="forEach.Execute context" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Activities</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="context" Type="System.Activities.NativeActivityContext" />
</Parameters>
<Docs>
<param name="context">To be added.</param>
<summary>To be added.</summary>
<remarks>To be added.</remarks>
</Docs>
</Member>
<Member MemberName="OnCreateDynamicUpdateMap">
<MemberSignature Language="C#" Value="protected override void OnCreateDynamicUpdateMap (System.Activities.DynamicUpdate.NativeActivityUpdateMapMetadata metadata, System.Activities.Activity originalActivity);" />
<MemberSignature Language="ILAsm" Value=".method familyhidebysig virtual instance void OnCreateDynamicUpdateMap(class System.Activities.DynamicUpdate.NativeActivityUpdateMapMetadata metadata, class System.Activities.Activity originalActivity) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Activities.Statements.ForEach`1.OnCreateDynamicUpdateMap(System.Activities.DynamicUpdate.NativeActivityUpdateMapMetadata,System.Activities.Activity)" />
<MemberSignature Language="VB.NET" Value="Protected Overrides Sub OnCreateDynamicUpdateMap (metadata As NativeActivityUpdateMapMetadata, originalActivity As Activity)" />
<MemberSignature Language="C++ CLI" Value="protected:&#xA; override void OnCreateDynamicUpdateMap(System::Activities::DynamicUpdate::NativeActivityUpdateMapMetadata ^ metadata, System::Activities::Activity ^ originalActivity);" />
<MemberSignature Language="F#" Value="override this.OnCreateDynamicUpdateMap : System.Activities.DynamicUpdate.NativeActivityUpdateMapMetadata * System.Activities.Activity -&gt; unit" Usage="forEach.OnCreateDynamicUpdateMap (metadata, originalActivity)" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Activities</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="metadata" Type="System.Activities.DynamicUpdate.NativeActivityUpdateMapMetadata" Index="0" FrameworkAlternate="netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8" />
<Parameter Name="originalActivity" Type="System.Activities.Activity" Index="1" FrameworkAlternate="netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8" />
</Parameters>
<Docs>
<param name="metadata">To be added.</param>
<param name="originalActivity">To be added.</param>
<summary>To be added.</summary>
<remarks>To be added.</remarks>
</Docs>
</Member>
<Member MemberName="Values">
<MemberSignature Language="C#" Value="public System.Activities.InArgument&lt;System.Collections.Generic.IEnumerable&lt;T&gt;&gt; Values { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property instance class System.Activities.InArgument`1&lt;class System.Collections.Generic.IEnumerable`1&lt;!T&gt;&gt; Values" />
<MemberSignature Language="DocId" Value="P:System.Activities.Statements.ForEach`1.Values" />
<MemberSignature Language="VB.NET" Value="Public Property Values As InArgument(Of IEnumerable(Of T))" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; property System::Activities::InArgument&lt;System::Collections::Generic::IEnumerable&lt;T&gt; ^&gt; ^ Values { System::Activities::InArgument&lt;System::Collections::Generic::IEnumerable&lt;T&gt; ^&gt; ^ get(); void set(System::Activities::InArgument&lt;System::Collections::Generic::IEnumerable&lt;T&gt; ^&gt; ^ value); };" />
<MemberSignature Language="F#" Value="member this.Values : System.Activities.InArgument&lt;seq&lt;'T&gt;&gt; with get, set" Usage="System.Activities.Statements.ForEach&lt;'T&gt;.Values" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Activities</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute>
<AttributeName>System.Activities.RequiredArgument</AttributeName>
</Attribute>
<Attribute>
<AttributeName>System.ComponentModel.DefaultValue(null)</AttributeName>
</Attribute>
<Attribute FrameworkAlternate="netframework-4.0">
<AttributeName>get: System.Runtime.TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")</AttributeName>
</Attribute>
<Attribute FrameworkAlternate="netframework-4.0">
<AttributeName>set: System.Runtime.TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Activities.InArgument&lt;System.Collections.Generic.IEnumerable&lt;T&gt;&gt;</ReturnType>
</ReturnValue>
<Docs>
<summary>The activity's collection of inputs for the execution of the <see cref="P:System.Activities.Statements.ForEach`1.Body" /> activity action.</summary>
<value>The collection of values.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Examples
The following code sample demonstrates setting the Values property of a <xref:System.Activities.Statements.ForEach%601> activity. This example is from the [DynamicActivity Creation](~/docs/framework/windows-workflow-foundation/samples/dynamicactivity-creation.md) sample.
[!code-csharp[wfs_DynamicActivityCreation#1](~/samples/snippets/csharp/VS_Snippets_CFX/wfs_dynamicactivitycreation/cs/program.cs#1)]
]]></format>
</remarks>
</Docs>
</Member>
</Members>
</Type>
You can’t perform that action at this time.