public static ControlType ControlType(Type type) { var @class = new Class(type); if ([email protected](typeof (ControlTypeMappingAttribute))) throw new CustomUIItemException("ControlTypeMappingAttribute needs to be defined for this type: " + type.FullName); var controlTypeMappingAttribute = @class.Attribute<ControlTypeMappingAttribute>(); return ControlType(controlTypeMappingAttribute.CustomUIItemType); }
public void AttributeValue() { Class @class = new Class(typeof(TestClass_WithAttribute)); CategoryAttribute categoryAttribute = @class.Attribute<CategoryAttribute>(); Assert.AreEqual("Normal", categoryAttribute.Name); }