
Microsoft Windows Workflow Foundation 4.0 Cookbook
By :

In this task, we will use the AddToCollection<T>
activity to add items to a collection object.
We need to make sure we have finished the task of Printing collection items for us to be able to use the CollectionPrinterActivity
activity in this task.
Create a Console Workflow Application:
Create a new Workflow Console Application and name it UsingAddToCollectionActivity
.
Create a visual workflow:
We need to perform the following actions:
Open the Workflow1.xaml
file that is created by default. Click the Imports button and type in System.Collections.ObjectModel
to import the System.Collections.ObjectModel
namespace to this workflow.
Drag a Sequence activity to the workflow designer and then drag an AddToCollection
activity onto the Sequence activity. Next, drag the customized CollectionPrinter
activity right below the AddToCollection
—the type is String
. Add a new ICollection<String>
variable named people
to...
Change the font size
Change margin width
Change background colour