well i want an enum i can use in switch function.
i need to get that enum using something like iValue.GetType().somethingidontknow()
so basically this system enum should contain all the basic reference types like int , string , long and so on.
thanks
views:
69answers:
1
+8
A:
You might want System.TypeCode. You can use Convert.GetTypeCode to get the TypeCode for an object or Type.GetTypeCode to get the TypeCode for a type. Note that this will be TypeCode.Object for any type that doesn't have its own value in the enumeration.
Edit: In case this is related to your other recent question, there is an overload of Convert.ChangeType that takes a TypeCode, so you can do things like Convert.ChangeType("123", TypeCode.Int32)
.
Quartermeister
2010-08-17 12:48:29
thanks, its a little related to my other question, i am still thinking of implementing my own switch for convertion function Convert<T>(String) so this why i need this enum.
Karim
2010-08-17 12:59:52