如何在 WF 中创建自定义接收活动?
我想创建一个 WF 接收活动,但自定义为使用固定合同和固定参数。我曾考虑过扩展接收活动并设置它的一些属性,但它是一个密封类。
哪种方法是最好的方法?
I would like to create a WF receive activity but customized to use a fixed contract and fixed parameters. I have thought in extending the Receive activity and set some of it properties, but it is a sealed class.
Which is the best aproach to do that?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您的设计人员可以使用 IActivityTemplateFactory 使用您想要的合同预先配置现有的发送/接收。您还可以添加可能需要的变量。这样,开发人员就不必输入每个参数。
Your designer can use an IActivityTemplateFactory to pre-configure the existing Send/Receive with the contract you want. You can also add variables that may be required. That way developers won't have to type in each of the parameters.
您创建一个 XAML 活动并将 Receive 活动放入其中。如果您向工作流项目添加服务引用,这正是该工具在为您生成预打包活动时所做的事情。
You create a XAML activity and drop the Receive activity in there. If you add a service reference to a workflow project that is exactly what the tooling does when it generates the prepackaged activities for you.