How-to add methods and properties of C# classes?

  • Thread starter Thread starter Martin R-L
  • Start date Start date
M

Martin R-L

Let's say I've got * C# classes. I also have a smorgasbord of methods,
properties, events and event handlers (behaviors).

In design time (runtime would also be nice but isn't a necessity), I'd like
to add 0..* of the behaviors to 0..* of my classes.

In DHTML and IE, I would have designed Behaviors (HTC files) for each
method/property/event/event handler. These also work fine in runtime.

What's the cleverest way to pull off the same thing in C#?

Thanx!
// Martin R-L
 
Martin,

I don't understand what you are trying to do exactly. If you mean you
are trying to add properties and methods to existing classes at runtime,
then this is going to be very, very difficult. Your approach to adding
dynamic behavior to a class would be best solved by having a generic
interface with events which are fired when the classes are being extended
are being modified (properties being changed, methods run, etc, etc).

Hope this helps.
 
Back
Top