在ReHosted Designer中为什么我无法获得其中的活动?以及如何获得当前的活动?

时间:2013-09-19 21:37:27

标签: c# workflow-foundation-4 workflow-activity workflow-rehosting

我正在使用重新托管的工作流设计器。在我的C#代码中,我可以访问WorkflowDesigner的实例。如何访问我所处的当前活动(光标处于)或我刚刚打开它。 这是我指的工作流程:

System.Activities.Presentation.WorkflowDesigner x;

如何访问x中的当前活动或所有活动。

The image of a Sequence parent and its two childs

我也试过这个:

 ModelService modelService = x.Context.Services.GetService<ModelService>();
 Activity a = modelService.Root.GetCurrentValue() as Activity;
 IEnumerable <Activity> MyActivities = WorkflowInspectionServices.GetActivities(a );

当我运行此代码时,根“a”中没有返回任何活动,换句话说,myActivities IEnumerable为空。

提前致谢。

1 个答案:

答案 0 :(得分:0)

我找到了如何获得所选活动的答案     选择sel = x.Context.Items.GetValue();

相关问题