R
Registered User
My initial post was to point out why your proposed reflection solutionWhy does it need to have any value? Just look at it as a theoretical
question so I can understand the language better. If you prefer not to
answer any questions for which you don't see any value, then just exercise
that prerogative.
wouldn't work, the name of the method is needed to get the MethodInfo
object and the MethodInfo object is needed to get the name of the
method. More specific details were requested but none were provided
save an irrelevant something about the Name property of a Windows
control.
Theoretical questions do not always provide concrete answers from
which sound implementations can result. In your case the theoretical
question is flawed because it does not consider methods of different
types that share the same name, methods of type that share the same
name (overloading) and methods which have no names (anonymous
delegates). Please note this flaw is not value-based.
I apologize for not providing the answer you want to hear. The
responses your question has received all have a commonality except for
the one provided by sqlguru. His answer is just like your
reflection-based solution, the name of the method is required to get
the name of the method.
regards
A.G.