locked
Switch Activity RRS feed

  • Question

  • Hi,
    Im hosting the WF4 designer,
    I want to add the Switch activity to the toolbox with specified cases, i write the following code but it is failed :
    ToolboxControl ctrl = new ToolboxControl();
    ToolboxCategory category = new ToolboxCategory("Activities");
    ToolboxItemWrapper tool8 = new ToolboxItemWrapper("System.Activities.Statements.Switch<System.Net.Mail.SmtpDeliveryMethod>", typeof(System.Activities.Statements.Switch<System.Net.Mail.SmtpDeliveryMethod>).Assembly.FullName, null, "Switch DeliveryMethod");
    category.Add(tool8);
    ctrl.Categories.Add(category);
    It is failed with exception how can i add the switch activity ?
    Thnx,
    khalil
    Wednesday, January 4, 2012 8:58 AM

Answers

  • I did find the solution by myself.
    • Marked as answer by khalil salhi Monday, January 9, 2012 12:31 PM
    Monday, January 9, 2012 12:31 PM

All replies

  • This is how Switch<SmtpDeliveryMethod> type's  full name looks like :

    "System.Activities.Statements.Switch`1[[System.Net.Mail.SmtpDeliveryMethod, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]"

    I suggest you to implement factory to create Switch<SmtpDeliveryMethod> activity.

    Sunday, January 8, 2012 2:23 PM
  • Hi,

    What should i write instead of the following line inorder to create the switch activity:
    ToolboxItemWrapper tool8 = new ToolboxItemWrapper("System.Activities.Statements.Switch<>", typeof(System.Activities.Statements.Switch<System.Net.Mail.SmtpDeliveryMethod>).Assembly.FullName, null, "tr");
    Thnx,
    khalil
    Sunday, January 8, 2012 3:43 PM
  • I did find the solution by myself.
    • Marked as answer by khalil salhi Monday, January 9, 2012 12:31 PM
    Monday, January 9, 2012 12:31 PM