Is there a way to programatically get the name of which method or property the current code is executing under?
void Test()
{
MessageBox.Show("This is a message from " + GetNameOfCurrentMethod);
}
I thought about throwing an exception, catching it and parsing the stack trace but there should be a better way to do this.