Using a customized extension

WF4 also allows us to define our own WF4 extensions. In this task, we will create a simple extension and use this extension in a workflow.

How to do it...

  1. Create a Workflow Console Application:

    Add a new Workflow Console Application to the Chapter06 solution and name it UsingCustomizedExtension.

  2. Create a customized extension:

    Add a new code file to the project and name the file SimpleExtension.cs. Fill the file with the following code:

    using System.Activities.Hosting; using System.Collections.Generic; using System; namespace UsingCustomizedExtension { public class SimpleExtension : IWorkflowInstanceExtension { private WorkflowInstanceProxy instance; public IEnumerable<object> GetAdditionalExtensions() { return null; } public ...

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.