Printing collection items

In this task, we will customize an activity that can print all collection items to Console Application.

How to do it

  1. Create a Workflow Console Application:

    Create a new Workflow Console Application and name it PrintingCollectionItems.

  2. Create an Activity that can print collection items to the Windows Console:

    Add a new Code Activity to the project and name it CollectionPrinter.cs. Refer to the following screenshot:

    How to do it

    Open the CollectionPrinter.cs file and alter the code as follows:

     using System; using System.Collections.Generic; using System.Activities; namespace PrintingCollectionItems { public sealed class CollectionPrinter<T> ...

Get Microsoft Windows Workflow Foundation 4.0 Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.