문제

I am working with a rehosted workflow designer. In my C# code I do have access to the instance of the WorkflowDesigner. How do I get access to the current activity that I am at (the cursor is at ) or I have just opened it. This is the workflow I am referring to:

System.Activities.Presentation.WorkflowDesigner x;

How do I access the current activity or all activities within the x.

The image of a Sequence parent and its two childs

I have tried this as well:

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

when I run this code there is NO activities returned within the root "a" in other words myActivities IEnumerable is empty.

Thanks in advance.

도움이 되었습니까?

해결책

I found the answer on how to get the selected activity Selection sel = x.Context.Items.GetValue();

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top