Where are SendAndReceiveReply and ReceiveAndSendReply?

Answered Where are SendAndReceiveReply and ReceiveAndSendReply?

  • Wednesday, February 17, 2010 2:05 AM
     
     
    I'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'?

    Regards,

    Nigel

All Replies

  • Wednesday, February 17, 2010 2:31 AM
     
     
    you need to go to following path to get them

    System.Activities.Core.Presentation.dll

    namespace System.ServiceModel.Activities.Presentation.Factories


    ReceiveAndSendReplyFactory

    SendAndReceiveReplyFactory

  • Wednesday, February 17, 2010 2:40 AM
     
     Proposed
    you can use following code to add sendAndReceiveReply
    ToolboxControl control = new ToolboxControl();
    ToolboxCategory cat = new ToolboxCategory();
    ToolboxItemWrapper wrap = new ToolboxItemWrapper(typeof(SendAndReceiveReplyFactory));
    cat.Add(wrap);
    control.Categories.Add(cat);

     the same as ReceiveAndSendReply
    and add the reference System.Activities.Core.Presentation.dll
    and using System.ServiceModel.Activities.Presentation.Factories;
  • Wednesday, February 17, 2010 5:23 AM
    Moderator
     
     
    (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.)

    Tim
  • 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 AM
     
     
    for 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
     
     Answered

    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: -

    System.Activities.Statements
    System.ServiceModel.Activities

    and you have to pick up factories from: -

    System.Activities.Core.Presentation.Factories
    System.ServiceModel.Activities.Presentation.Factories

    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
     
     

    Hi Nigel,

    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!

    Ric

  • Friday, February 17, 2012 8:09 PM
     
     
    Sorry about that. I found my problem. Thanks!