views:

53

answers:

1

I would like to create a custom reusable workflow foundation activity based on the FlowChart activity. All of the built in classes are sealed therefore I cannot inherit it. These activities will be used in an application which re-hosts the workflow designer and used by non-developers. I can inherit from the NativeActivity class. However, I need to be able to drag and drop activities into this custom activity just like the FlowChart activity.

Summary: does anyone have an example or ideas on how to implement a custom workflow activity which behaves just like the FlowChart (in the designer and at runtime) but allows me to extend the class with my own custom logic behind the scenes?

I think I may be simply looking for or reusing the same ActivityDesigner that the FlowChart uses. Is that possible?

A: 

If I had to do this, I would probably go into Reflector and find the class that I want to modify, then copy and paste it into a project in VS. At this point, I would compile, find out what other internal/private classes it depends on, and copy those. After iterating a couple dozen times, I would have something that compiles without errors and I can start integrating it into the rest of my system.

It's not pretty, but I don't think there's any other way to extend an internal or private class.

Of course you could do this whole thing, only to find that the designer has some special case code that looks for the particular class you want to extend, such that getting the behavior you want is impossible.

Gabe
It is appearing more and more that what' I'm looking for is to tell my new custom Activity (which inherits from NativeActivity just like the FlowChart activity) to use the FlowChart Designer by adding the [Designer(...)] attribute; however, it appears that the FlowChart Designer isn't public or has a public contstructor, so I can't seem to get to it. I basically want the FlowChart designer functionality in the Workflow Designer, but custom Native Activity functionality, if that makes sense.
e-rock