As far as I know you can use switch statements with value type only.
Here is your code refactored:
Code:if (ob1.GetType() == typeof(Double) && ob2.GetType() == typeof(Double) ){ return (double)ob1 < (double)ob2; } return false;
| CodeGuru Home | VC++ / MFC / C++ | .NET / C# | Visual Basic | VB Forums | Developer.com |
|
Results 1 to 8 of 8
Thread: Urgent : gettype of an objectThreaded View
|
Click Here to Expand Forum to Full Width |