Is there a way to get all caller of C# method ie:
public string Caller(string str)
{
Customer cust = new Customer();
cust.Firstname = "Peter";
cust.LastName = "Beamer";
string t = getName(cust);
return t;
}
private string getName(Customer customer)
{
return customer.Firstname +" "+ customer.LastName;
}
would return: Caller.
All I can get now is method body text using EnvDTE.CodeFunction. Maybe there is a better way to achieve it than trying to parse this code.
Note: I don't want to get current method's calling method name. I want that If I give name of the method then It will return passed method's calling methods name.