J
Jeff Dege
In a non-static method, I can obtain the Type of the class containing
that method with "this.GetType()".
In a static method, I cannot, of course. There is no "this".
I have a method in another class that needs to be passed a Type object
associated with a class. I'm calling that method from a static method,
and want to pass the Type object associated with the class that contains
that static method.
I can, of course, use "typeof(MyClass)". But that means redundancy of
the sort that just bothers me.
that method with "this.GetType()".
In a static method, I cannot, of course. There is no "this".
I have a method in another class that needs to be passed a Type object
associated with a class. I'm calling that method from a static method,
and want to pass the Type object associated with the class that contains
that static method.
I can, of course, use "typeof(MyClass)". But that means redundancy of
the sort that just bothers me.