static void Run() { AutoResetEvent applicationUnloaded = new AutoResetEvent(false); WorkflowApplication application = new WorkflowApplication(workflow); application.InstanceStore = instanceStore; SetupApplication(application, applicationUnloaded); StepCountExtension stepCountExtension = new StepCountExtension(); application.Extensions.Add(stepCountExtension); application.Run(); Guid id = application.Id; applicationUnloaded.WaitOne(); while (stepCountExtension.CurrentCount < totalSteps) { application = new WorkflowApplication(workflow); application.InstanceStore = instanceStore; SetupApplication(application, applicationUnloaded); stepCountExtension = new StepCountExtension(); application.Extensions.Add(stepCountExtension); application.Load(id); string input = Console.ReadLine(); application.ResumeBookmark(echoPromptBookmark, input); applicationUnloaded.WaitOne(); } }
protected override void Execute(CodeActivityContext context) { StepCountExtension stepCountExtension = context.GetExtension <StepCountExtension>(); stepCountExtension.IncrementStepCount(); }
protected override int Execute(CodeActivityContext context) { StepCountExtension stepCountExtension = context.GetExtension <StepCountExtension>(); return(stepCountExtension.CurrentCount); }