Is there a better way to do this, where C:B:A:
The problem with IsSubclassOf() is that if the type is A, it returns false.Code:if (X.GetType().IsSubclassOf(typeof(A)) || X.GetType() == typeof(A)) { A bob = (A)X; }
| CodeGuru Home | VC++ / MFC / C++ | .NET / C# | Visual Basic | VB Forums | Developer.com |
|
Results 1 to 4 of 4
Thread: Simple typeof question
|
Click Here to Expand Forum to Full Width |