I was wondering if it is possible (even through reflection et similia) to get a caller derived class inside a static method called a base class.
For example, I have a base class with a static method:
public MyBaseClass { public static void MyBaseClassStaticMethod() { } }
and derived from the class:
public MyDerivedClass : MyBaseClass { }
then I call:
MyDerivedClass.MyBaseClassStaticMethod()
Is it possible inside the MyBaseClassStaticMethod method MyBaseClassStaticMethod know which type is called by the caller?
(i.e. MyDerivedClass )
I need a line ...
reflection c # derived-class
Teejay Apr 30 '13 at 14:05 2013-04-30 14:05
source share