P
proxyuser
I want to do something like this
string s = x.method().AsString()
meaning, I'd like to programmatically retrieve the method name (not the name
of the method currently running, but the name of some other known method.)
The reason I want to do this is I want to display as output to the user the
name of the method being called. I don't want to hard code this value
because if the method name ever changes, I don't want to count on the dev
remembering to change the output string. It would be acceptable to code it
in such a way that it caused a (1) runtime or preferrably a (2) compile time
error if the dev forgot to keep something in synch. But it would be best if
it (3) just happened automatically.
One option for (1) would be to use reflection such as
MethodInfo mi = x.GetType().GetMethod("method")
and then display
mi.Name
but this would be the least preferrable of the solutions - (3) is preferred

string s = x.method().AsString()
meaning, I'd like to programmatically retrieve the method name (not the name
of the method currently running, but the name of some other known method.)
The reason I want to do this is I want to display as output to the user the
name of the method being called. I don't want to hard code this value
because if the method name ever changes, I don't want to count on the dev
remembering to change the output string. It would be acceptable to code it
in such a way that it caused a (1) runtime or preferrably a (2) compile time
error if the dev forgot to keep something in synch. But it would be best if
it (3) just happened automatically.
One option for (1) would be to use reflection such as
MethodInfo mi = x.GetType().GetMethod("method")
and then display
mi.Name
but this would be the least preferrable of the solutions - (3) is preferred
