Reworking Workflow 4 Designer Adds Foreach Activity To Toolbar

I use designer reorganization patterns and try to put common types in the toolbar, however I cannot get it to work.

I tried using XAML:

<sapt:ToolboxItemWrapper  AssemblyName="{StaticResource AssemblyName}">
    <sapt:ToolboxItemWrapper.ToolName>
        System.Activities.Statements.ForEach
    </sapt:ToolboxItemWrapper.ToolName>
</sapt:ToolboxItemWrapper>

and based on the code:

Type t = Type.GetType("System.Activities.Statements.Foreach, System.Activities, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35");
ToolboxItemWrapper w = new ToolboxItemWrapper(t);
category.Add(w);

however, none of them seem to work. Any suggestions?

+3
source share
1 answer

You leave something that doesn't work, but I assume that you cannot add child activity to ForEach in the constructor.

, Body - ActivityAction, Activity, . , ForEachWithBodyFactory .

. ForEach .

var cat = new ToolboxCategory("Standard Activities");
cat.Add(new ToolboxItemWrapper(typeof(ForEachWithBodyFactory<>)));
+5

Source: https://habr.com/ru/post/1739303/


All Articles