예제 #1
0
        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();
            }
        }
예제 #2
0
        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();
            }
        }
예제 #3
0
        protected override void Execute(CodeActivityContext context)
        {
            StepCountExtension stepCountExtension = context.GetExtension <StepCountExtension>();

            stepCountExtension.IncrementStepCount();
        }
예제 #4
0
        protected override int Execute(CodeActivityContext context)
        {
            StepCountExtension stepCountExtension = context.GetExtension <StepCountExtension>();

            return(stepCountExtension.CurrentCount);
        }