我正在使用重新托管的工作流设计器。在我的C#代码中,我可以访问WorkflowDesigner的实例。如何访问我所处的当前活动(光标处于)或我刚刚打开它。 这是我指的工作流程:
System.Activities.Presentation.WorkflowDesigner x;
如何访问x中的当前活动或所有活动。
我也试过这个:
ModelService modelService = x.Context.Services.GetService<ModelService>();
Activity a = modelService.Root.GetCurrentValue() as Activity;
IEnumerable <Activity> MyActivities = WorkflowInspectionServices.GetActivities(a );
当我运行此代码时,根“a”中没有返回任何活动,换句话说,myActivities IEnumerable为空。
提前致谢。
答案 0 :(得分:0)
我找到了如何获得所选活动的答案 选择sel = x.Context.Items.GetValue();