WF本质论 读书心得 2 WF程序 下

WF运行时
    实例化一个System.Workflow.Runtime.WorkflowRuntime对象,这样的程序称为宿主程序(host)
    WorkflowRuntime就是上一章的MythicalRuntime, WorkflowInstance就是上一章的ProgramHandle

    要使用TypeProvier类将包含活动的dll加载到runtime:如下:
            using (WorkflowRuntime runtime = new WorkflowRuntime())
            
{
                TypeProvider tp 
= new TypeProvider(runtime);
                tp.AddAssemblyReference(
"Essential.dll");
                runtime.AddService(tp);

                runtime.StartRuntime();
            }

    通过XmlReader读取xoml文件,再WorkflowInstance = runtime.CreateWorkflow(reader);得到一个基于该xoml的活动赋予instance

钝化passivate
posted @ 2008-02-26 08:45  包建强  Views(532)  Comments(0Edit  收藏  举报