Static Constructor of Abstract class and Derived Classes

  • Thread starter Thread starter steenbt
  • Start date Start date
S

steenbt

Is there a way (using Reflection or anything else) to know what derived class
caused a static contructor to be called?
 
steenbt said:
Is there a way (using Reflection or anything else) to know what derived class
caused a static contructor to be called?

Not as far as I'm aware, and to be honest I'd be suspicious of a design
which relied on that. What are you trying to do? We may be able to
suggest a better idea.
 
Is there a way (using Reflection or anything else) to know what derived class
caused a static contructor to be called?

Not really. At least not AFAIK , not even the StackTrace can be used
as the constructors are called from the top of the tree down.

What are you trying to do though?
 
Back
Top