Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. WCF and WF
  4. How to get a "base" custom activity clas NOT to appear in the WF toolbox

How to get a "base" custom activity clas NOT to appear in the WF toolbox

Scheduled Pinned Locked Moved WCF and WF
asp-netvisual-studiotutorial
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    AJarrett
    wrote on last edited by
    #1

    I have a set of WF custom activities that inherit core behaviors from from a base activity class. So the hierarchy is: SomeCustomActivity : MyActivityBase : Activity I would like SomeCustomActivity to appear in the VS 2008 WF toolbox (it does) but NOT MyActivityBase (it does, no matter what I try). Seems like this should be doable fairly easily, after all Activity itself never appears in the toolbox. AJ

    A 1 Reply Last reply
    0
    • A AJarrett

      I have a set of WF custom activities that inherit core behaviors from from a base activity class. So the hierarchy is: SomeCustomActivity : MyActivityBase : Activity I would like SomeCustomActivity to appear in the VS 2008 WF toolbox (it does) but NOT MyActivityBase (it does, no matter what I try). Seems like this should be doable fairly easily, after all Activity itself never appears in the toolbox. AJ

      A Offline
      A Offline
      Aviad P
      wrote on last edited by
      #2

      Decorate your base activity class with the ToolboxItem attribute thus:

      [ToolboxItem(false)]

      A 1 Reply Last reply
      0
      • A Aviad P

        Decorate your base activity class with the ToolboxItem attribute thus:

        [ToolboxItem(false)]

        A Offline
        A Offline
        AJarrett
        wrote on last edited by
        #3

        Many thanks for your response, Aviad. Your suggestion turns out to be half the solution. In addition to decorating the base class as you suggest, you must follow that with decorating any derived classes with: [ToolboxItemAttribute(typeof(ActivityToolboxItem))] If you don't do this, the derived classes inherit the [ToolboxItem(false)] from the base class. (I can't take credit for this; the whole solution was suggested to me in another forum.)

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups