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);
        }
예제 #2
0
        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;
        }