private static DecorationAttributeDrawer FindDrawerForAttribute(DecorationAttribute fieldAttribute) { foreach (Type drawerType in derivedTypes) { var drawerAttribute = (CustomDecorationDrawerAttribute) drawerType.GetCustomAttributes(typeof(CustomDecorationDrawerAttribute), true)[0]; if (drawerAttribute.attributeType == fieldAttribute.GetType()) { return((DecorationAttributeDrawer)Activator.CreateInstance(drawerType)); } } return(null); }
private static DecorationAttributeDrawer FindDrawerForAttribute(DecorationAttribute fieldAttribute) { foreach (Type drawerType in derivedTypes) { var drawerAttribute = (CustomDecorationDrawerAttribute) drawerType.GetCustomAttributes(typeof(CustomDecorationDrawerAttribute), true)[0]; if (drawerAttribute.attributeType == fieldAttribute.GetType()) { return (DecorationAttributeDrawer)Activator.CreateInstance(drawerType); } } return null; }