如何使用 CodeActivty的结果在WF 4.0中?

发布于 2024-08-06 18:20:09 字数 342 浏览 8 评论 0原文

我在 .NET 4.0 beta 1 WF 项目中创建了一个自定义活动。它的定义是:

public class GetCurrentUserMailAddress : CodeActivity<string>

因为我读到这是返回单个结果的最有效的方式。

最后,我使用以下方法设置结果:

context.SetValue(Result, up.EmailAddress);

但现在我很难在工作流程中使用它。我想在下一个活动中使用该值,但找不到它。

如何在下一个活动中引用一个自定义活动的结果?

I've created a custom activity in a .NET 4.0 beta 1 WF project. It's defined as:

public class GetCurrentUserMailAddress : CodeActivity<string>

because I've read that this is the most efficient way of returning a single result.

At the end, I set the Result using:

context.SetValue(Result, up.EmailAddress);

But now I'm struggling to use it in my Workflow. I want to use the value in my next activity but I can't find it.

How do I reference the Result from one custom activity in the next activity?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

这样的小城市 2024-08-13 18:20:09

没关系。我本来就很厚。为了防止其他人遇到困难,自定义活动的“属性”窗口包含一个“结果”属性。将您的变量名称粘贴在那里,它将填充您的 Result OutArgument 的值。

Never mind. I was being thick. Just in case anyone else is struggling, the Properties window for the custom activity contains a Result property. Stick your variable name in there and it will be populated with the value of your Result OutArgument.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文