Windows工作流书签

时间:2012-05-21 01:28:30

标签: workflow-foundation-4 workflow-foundation workflow-activity

我使用书签

执行此工作流程
namespace wwwfff
{

    public sealed class CodeActivity3 : NativeActivity
    {
        public InArgument<string> EventName1

        { get; set; }



        public OutArgument<string> Data1

        { get; set; }



        protected override void Execute(NativeActivityContext context)
        {

            context.CreateBookmark(EventName1.Get(context), new BookmarkCallback(HandleEvent));
            Console.WriteLine("Pppppppppppp");
        }



        private void HandleEvent(NativeActivityContext context, Bookmark bookmark, object obj)
        {

            if (obj != null)
            {

                Data1.Set(context, obj.ToString());

            }

        }
    }
}

我在程序中写

class Program
    {
        static void Main(string[] args)
        {
            WorkflowApplication wf = new WorkflowApplication(new Workflow1());
            wf.Run();
           wf.ResumeBookmark("C1", "Hello word");

        }
    }

但它没有输入“ppppppp” 工作流程仅从->CodeActivity3->writline()开始 感谢

1 个答案:

答案 0 :(得分:1)

您可能需要覆盖CodeActivity3类

中的属性
protected override bool CanInduceIdle { get { return true; } }