WF4 活动没有 ID
我想知道如何获取一个简单活动的 ID。例如:
Sequence s = new Sequence();
string id = s.Id;
id 始终为 null,并且由于它有一个私有 Setter,我无法设置此值。
在什么情况下这个值会由谁填充Id?
非常感谢您的回答。
I was wondering, how to get an Id for a simple activity. For example:
Sequence s = new Sequence();
string id = s.Id;
The id is always null and as it has a private Setter I cannot set this value.
Under which circumstances will this value be filled with an Id and by whom?
Thanks a lot for your answers.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
ID 在您使用 WorkflowDesigner 时或在运行时设置。但即便如此,使用它也可能很棘手,因为它可以在 WorkflowDesigner 中采用不同的形式,具体取决于您加载工作流的方式。
The ID is set when you use the WorkflowDesigner or at runtime. But even then it can be tricky to work with because it can take on a different form in the WorkflowDesigner depending on how you load the workflow.
您可以使用 WorkflowInspectionServices 列出根活动中的活动。使用 WorkflowInspectionServices 时,会设置 id。
使用像这样的递归函数:
You may use WorkflowInspectionServices to list activities from the root activity. When using WorkflowInspectionServices, the ids are set.
With a recursive function like this one :