Hey everyone,
Trying to figure out how I can tell if I'm looking at a UserAttribute or an IntegerAttribute when pulling in the category definition.
The type for both an int and a user filed are "Integer", I can try to cast to IntegerAttribute and then catch the InvalidCastException but I don't see how that's the proper approach here. I shouldn't have to catch an exception to determine the type of field.
I've also tried getting the AttributeGroupDefinition, and the CategoryTemplate (DataValue[]) to see what they return; but likewise they all report "Integer"
Any advice would be greatly appreciated. Thanks!
C# code:
AttributeGroupDefinition agd = dmc.GetCategoryDefinition(ref auth, categoryID);
OTWS.Attribute[] als = agd.Attributes;
foreach (OTWS.Attribute in als) s += "ATT: " + a.Type;
Solution provided by Pramod Mohandas:
if (attribute is UserAttribute) { ... }