Link to home
Start Free TrialLog in
Avatar of glowas
glowas

asked on

PropertyDescriptor.PropertyType check if int ???

How can I check if PropertyDescriptor.PropertyType is type int?
PropertyDescriptor objPropDesc;
... set the objPropDesc ...
and...
if (objPropDesc.PropertyType is Int16 || objPropDesc.PropertyType is Int32 || objPropDesc.PropertyType is Int64)

this if never works...
Avatar of glowas
glowas

ASKER

I did it this way for now, but I don't like it because it is only comparing the type name.
if (objPropDesc.PropertyType.FullName == "System.Int16" .....)
But it works...
Any better solutions?
ASKER CERTIFIED SOLUTION
Avatar of b1xml2
b1xml2
Flag of Australia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial