Partilhar via


RangeEnumeration Activity

This topic applies to Windows Workflow Foundation 4 (WF4).

This sample demonstrates how to create a custom activity that iterates over a collection of numbers.The following table details the main files included in the sample.

File name Description

RangeEnumeration.cs

Defines a custom activity named RangeEnumeration that overrides the NativeActivity class and loops through a series of numbers.

RangeEnumerationSample.cs

A client application that uses the RangeEnumeration activity to iterate over a collection of numbers.

The following table details the properties of the RangeEnumeration activity.

Property Description

Start

The integer to start the loop from.

Stop

The integer to stop the loop at.

Step

Specifies how much to iterate each time.

Body

Specifies the code to execute during each iteration.

To use this sample

  1. Using Visual Studio 2010, open the RangeEnumeration.sln solution file.

  2. To build the solution, press CTRL+SHIFT+B.

  3. To run the solution, press CTRL+F5.

Dd797588.Important(en-us,VS.100).gif Note:
The samples may already be installed on your machine. Check for the following (default) directory before continuing.

<InstallDrive>:\WF_WCF_Samples

If this directory does not exist, go to Windows Communication Foundation (WCF) and Windows Workflow Foundation (WF) Samples for .NET Framework 4 to download all Windows Communication Foundation (WCF) and WF samples. This sample is located in the following directory.

<InstallDrive>:\WF_WCF_Samples\WF\Scenario\ActivityLibrary\RangeEnumeration