Possible Duplicate:
Reflection in C#: How do I get the calling method name and type?
Let's say I have two classes:
public class Foo {
public Foo() {
Bar.Pirate();
}
}
public static class Bar {
public static void Pirate() {
Type callingClassType = ...
}
}
Within Pirate()
, how do I get the Type
of the class (Foo
) that called Pirate()
?