I have a string variable that stores the datatype name. Datatype name can be any datatype from native to user defined.
Examples:
string sType = "System.Boolean ";
string sType = "System.Drawing .Color";
string sType = "MyNamespace.My Class.Helper";
Is there any easier (inbult) way to check if sType is a native type or a user defined type. And also, can I get the list of all the possible values of the datatype stored in sType? Example: Boolean - true, false and Color should return all the system colors.
or, do I need to write code like:
Examples:
string sType = "System.Boolean ";
string sType = "System.Drawing .Color";
string sType = "MyNamespace.My Class.Helper";
Is there any easier (inbult) way to check if sType is a native type or a user defined type. And also, can I get the list of all the possible values of the datatype stored in sType? Example: Boolean - true, false and Color should return all the system colors.
or, do I need to write code like:
Code:
if (sType == "System.Boolean") { //do something } else if (Type == "System.Drawing.Color") { //do something, but how to get the list of all the colors? }
Comment