保存在重新托管的设计器 WF 4.0 中设计的工作流程
我为用户提供了一个带有自定义活动的重新托管设计器,以便用户可以创建自己的工作流程。现在我想为用户提供选项,将在重新托管的设计器中设计的工作流程(Xaml 文件)保存在 WF 4.0 中。我想保存工作流程以及活动变量/属性值。我怎样才能做到这一点?
I have given user a re-hosted designer with custom activites so that user can create its own workflows. Now I want to give user option to save the workflow designed in re-hosted designer, an Xaml file, in WF 4.0. I want to save workflow along with the activity variable/property values. How can I do that?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
两个主要选项
1) WorkflowDesigner.Save() 方法(System.Activities.Design (Beta1)/System.Activities.Presentation (Beta2))
2) XamlServices.Save() 方法(System.Xaml),带有对象(对象图) )来保存 EditingContext.ModelTreeManager.Root
尝试将 WorkflowDesigner.Save() 作为您的第一个选择,如果您发现需要做一些在 WorkflowDesigner.Save() 中不起作用的事情,则可以使用 XamlServices(),因为有更多低级控制选项可用。
Two main options
1) WorkflowDesigner.Save() Method (System.Activities.Design (Beta1)/System.Activities.Presentation (Beta2))
2) XamlServices.Save() Method (System.Xaml), with the object (object graph) to save being EditingContext.ModelTreeManager.Root
Try WorkflowDesigner.Save() as your first option, and fall back on XamlServices() if you find you need to do something that won't work in WorkflowDesigner.Save(), since there are more low-level control options available.
在重新托管的设计器中设计的工作流可以通过workflow.save(filename)方法与活动的属性值和定义的变量一起保存。该方法可以在重新托管设计器的任何事件处理程序内调用,例如在表单关闭事件上。
workflow designed in re-hosted designer can be saved by workflow.save(filename) method along with the property values of activites and defined variables. The method can be called inside any event handler of re-hosted designer for example on form closing event.