locked
Flowswitch in rehoster RRS feed

  • Question

  • I am working on a rehoster and would like to add the FlowSwitch<T> to the toolbox.  I have it working via 

     

    ToolboxCategory cat = new ToolboxCategory(CategoryName);
    
    cat.Add(new ToolboxItemWrapper(typeof(FlowSwitch<Type>), "FlowSwitch<T>"));
    

     

    but when I place it in the flowchart it doesn't ask me the type I want to switch.  It just defaults to <Type>.  How can I get it to ask the type and instantiate properly?

    Thanks in advance,
    John

    p.s.  I see the same behavior holds with Switch<T>.  I assume the answer will be the same for them both.

     

    Friday, March 11, 2011 8:14 PM

Answers

  • Hi John, 

    I guess you should pass it like this:

    ToolboxCategory cat = new ToolboxCategory(CategoryName);
    
    cat.Add(new ToolboxItemWrapper(typeof(<strong>FlowSwitch<></strong>), "FlowSwitch<T>"
    

    Note the typeof(FlowSwitch<>) typeof on unbounded generic type.

    Look here for details:

    http://msdn.microsoft.com/en-us/library/ms379564(v=vs.80).aspx

    HTH

     


    Adriano
    • Marked as answer by John Hennesey Friday, March 11, 2011 9:08 PM
    Friday, March 11, 2011 9:05 PM

All replies

  • Hi John, 

    I guess you should pass it like this:

    ToolboxCategory cat = new ToolboxCategory(CategoryName);
    
    cat.Add(new ToolboxItemWrapper(typeof(<strong>FlowSwitch<></strong>), "FlowSwitch<T>"
    

    Note the typeof(FlowSwitch<>) typeof on unbounded generic type.

    Look here for details:

    http://msdn.microsoft.com/en-us/library/ms379564(v=vs.80).aspx

    HTH

     


    Adriano
    • Marked as answer by John Hennesey Friday, March 11, 2011 9:08 PM
    Friday, March 11, 2011 9:05 PM
  • Oh, my do I feel stupid now.  That was it - thank you!
    Friday, March 11, 2011 9:08 PM