I am receiving a click event for a MenuItem in a Windows Forms app, but Im using a generic handler for all MenuItem clicks and I need to dynamically determine the name of the particular MenuItem in question because I am using part of the name to embed metadata describing what the MenuItem is supposed to do.
Is there a way to do obtain a variables name using reflection?
I suppose I could subclass MenuItem and add a field to store the information Im trying to extract, but if I can avoid that I would like to.
Is there a way to do obtain a variables name using reflection?
I suppose I could subclass MenuItem and add a field to store the information Im trying to extract, but if I can avoid that I would like to.