J
Julie
I have a situation where I have multiple objects that aren't related in any way
(no base class), but all have a couple of common methods/properties. I'm
looking for a clean way to call a particular method/property for the object,
w/o having to resort to a bunch of if-is-cast statements.
Here is what I'd like to be able to do:
object source = GetSource();
object width = some_mystery_function(source, "Width");
Get what I'm after? I'm suspecting that reflection is what I need, but have no
experience w/ it, and would rather have some pointers before jumping into it.
(no base class), but all have a couple of common methods/properties. I'm
looking for a clean way to call a particular method/property for the object,
w/o having to resort to a bunch of if-is-cast statements.
Here is what I'd like to be able to do:
object source = GetSource();
object width = some_mystery_function(source, "Width");
Get what I'm after? I'm suspecting that reflection is what I need, but have no
experience w/ it, and would rather have some pointers before jumping into it.