自定义 Activity 中的动态参数?
我们正在我们自己的应用程序中重新托管 WF-4 设计器。 我们有一个叫做过滤器的东西。现在我们需要一个让您运行此过滤器的活动 并在 ForEach 中处理结果。够简单的。 但这些过滤器有一个参数列表(用于运行过滤器),需要在工作流主机中填写。过滤器参数列表可以是从 0 到 N 的任何值。
在用户设置 FilterId 后,我们是否可以创建该 Filter 的实例,检查其参数列表并将这些参数添加到 Activity 中?参数基本上只是名称、类型,并且需要用户填写其值。
另一件事,我们不想在运行时创建 Filter 的实例,那会太昂贵。在运行时,我们只需要过滤器 ID 和参数值列表。
如果有一种方法可以在 FilterId 更改时更新它并验证此列表中的所有参数都有值,我会很高兴拥有参数的静态属性。
We are re-hosting the WF-4 designer in our own app.
We have something called a Filter. Now we want an activity that lets you run this filter
and work with the results in a ForEach. Simple enough.
But these Filters have a list of parameters (for running the filter) that need to be filled in the workflow host. The list of filter parameters can be anything from 0 to N.
After the user sets FilterId, is there a way we can create an instance of that Filter, examine its list of parameters and add those parameters to the Activity? The parameters are basically just Name, Type and needs its Value filled out by the user.
Another thing, we do not want to create an instance of the Filter at run-time, that would be too expensive. At run-time, we just need the filter id and the list of parameter Values.
I'd be happy with having a static property for parameters, if there is a way to update it when FilterId changes and validate that all parameters in this list have values.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我自己没有这样做过,但如果我没有记错的话,我已经看到其他人通过实现 ICustomTypeDescriptor 接口来执行类似的操作。这就是 Interop 活动用来将 WF3 活动的属性显示为 WF4 InArgument/OutArguments。
I haven't done this myself but if I am not mistaken I have seen other people do something like this by implementing the ICustomTypeDescriptor interface. And that is what the Interop activity uses to display the properties of the WF3 activity as WF4 InArgument/OutArguments.