using System;
using System.Collections.Generic;
using System.Text;
using System.Workflow.Runtime;
using System.Workflow.Activities;
namespace WorkflowIntroduction
{
publicclass SimpleWorkflow : SequentialWorkflowActivity
{
public SimpleWorkflow()
{
CodeActivity ca = new CodeActivity();
ca.ExecuteCode += delegate
{
Console.WriteLine("activity executed");
Console.WriteLine("Press <enter> to stop the workflow");
Console.ReadLine();
};
this.Activities.Add(ca);
}
}
class Program
{
staticvoid Main(string[] args)
{
WorkflowRuntime runtime = new WorkflowRuntime();
runtime.StartRuntime();
WorkflowInstance instance = runtime.CreateWorkflow(typeof(SimpleWorkflow));
instance.Start();
runtime.StopRuntime();
}
}
}