Hi,
Suppose I have the following pseudo-class-ish code:
class A
{
member1;
member2;
public static Method() { return member1; }
}
class B : A
{
public static string Xxstring = "XXXXX";
B()
{
member1 = Xxstring;
member2 = Xxstring + Xxstring;
}
}
Now if I do the following:
B.Method() it will not work (return null) because the B's constructor was
not called as a result of the operation.
So I was hoping if there was some way i can determine from inside A.Method
that it was called from B and then I could get the type in B, and then
replace the member1 call with the Xxstring.
I have 80 or so child-classes of type A in my code and was hoping i could
refactor by doing this. Thanks.