Hi,
I have multiple instances of a class in my code, each with difference configs etc. This class has a delegate eventhandler method which receives event from a sender and then need to perform some action with one of the above objects.
I would like to know if reflection can resolve this.
private CatClass cat1;
private CatClass cat2;
private CatClass cat3;
I would like to avoid checking each instance independently to see if it's the object I want. But would instead like to somehow retrieve the object instance which the sending event has identified.
So
private void delegateHandler(string senderName, object sender, CustomEventType evt)
{
// given reciept of the senderName string,
// how do I perform an action on say the cat2 object
// Is it possible to ask the class if it has an object defined
// called 'cat2' and then proceed with performing an action on that object
}
Thanks for the help.