Wednesday, February 17, 2010 2:05 AMI've re-hosted the workflow designer and must say that I'm very impressed, but there's 2 activities that appear when hosted in VS that I can't find - SendAndReceiveReply and ReceiveAndSendReply. I managed to find the other messaging activites hiding in System.ServiceModel.Activities, but these last 2 are proving somewhat elusive.
Anyone know where they live? Are they in fact a 'VS special'?
Wednesday, February 17, 2010 2:31 AMyou need to go to following path to get them
Wednesday, February 17, 2010 2:40 AMyou can use following code to add sendAndReceiveReply
ToolboxControl control = new ToolboxControl();
ToolboxCategory cat = new ToolboxCategory();
ToolboxItemWrapper wrap = new ToolboxItemWrapper(typeof(SendAndReceiveReplyFactory));
the same as ReceiveAndSendReply
and add the reference System.Activities.Core.Presentation.dll
and using System.ServiceModel.Activities.Presentation.Factories;
- Proposed As Answer by Ye Yu - MSFTMicrosoft Employee Wednesday, February 17, 2010 2:41 AM
Wednesday, February 17, 2010 5:23 AMModerator(Random related tip hoping to forstall a later FAQ: in your toolbox you should also use the ForEachWithBodyFactory and ParallelForEachFactory in the S.A.C.P assembly, rather than System.Activities.ForEach<T> etc.)
Wednesday, February 17, 2010 5:59 AM...and I presume I should replace System.Activites.Pick with System.Activities.Core.Presentation.Factories.PickWithTwoBranchesFactory?
Wednesday, February 17, 2010 6:03 AMfor parrallelforeach, you should use ParallelForEachWithBodyFactory<> in toolbox
for foreach, you should use ForEachWithBodyFactory<>
for pick, you should use PickWithTwoBranchesFactory
Wednesday, February 17, 2010 6:14 AM
Thanks a lot. I now have all activities showing up (with their correct icons thanks to http://blogs.msdn.com/asgisv/archive/2010/02/10/displaying-net-framework-4-built-in-workflow-activity-icons-in-a-rehosted-workflow-designer.aspx).
Just to confirm - you have to pick up activities from: -
and you have to pick up factories from: -
You use factories for: -
ForEachWithBodyFactory<T> for ForEach<T>
ParallelForEachWithBodyFactory<T> for ParallelForEach<T>
PickWithTwoBranchesFactory for Pick
ReceiveAndSendReplyFactory for ReceiveAndSendReply
SendAndReceiveReplyFactory for SendAndReceiveReply
N.B. - The article explaining how to pick up the correct icons has a bug in the sample. You just need to strip the `1 off the end of the type name if it's a generic type, before using it as a resource key, or you won't find the bitmap!
You've certainly spread the information around, but it does all work if you hunt it down - a huge improvement on WF3 designer re-hosting experience!
Thanks for all the help:-)
- Marked As Answer by Nigel Page Wednesday, February 17, 2010 6:14 AM
Friday, February 17, 2012 8:03 PM
Do you know where I could get the icons for the System.ServiceModel.Activities? The System.Activities.Statements icons load correctly but the servicemodel.activities do not. Any help would be appreciated. Thanks!
Friday, February 17, 2012 8:09 PMSorry about that. I found my problem. Thanks!