Imagine a method like this ( in Win Forms):
//First method
private void buttonStart_Click(object sender, EventArgs e)
{
//I call another method here
this.GetData(sender, null)
}
//Second method
private void GetData(object sender, EventArgs e)
{
//how to check IF calling method is buttonStart_Click ???
if(sender.Equals == buttonStart_Click)
{
//DO BLAH BLAH
}
}
I hope I was clear, that is I want to know which method is calling 'GetData'. note I know I can have a global variable and set it to something, but I want to know if there is a DIRECT way to do this?
Thanks.