/// <summary> Creates a new instance of the drawer or returns a reusable instance from the pool. </summary> /// <param name="attribute"> The PropertyAttribute that these drawer represent and whose DectoratorDrawer is used when drawing the control. </param> /// <param name="parent"> The parent drawer of the created drawer. Can be null. </param> /// <param name="drawerType"> Type of the DecoratorDrawer that is used for drawing the control. </param> /// <returns> The instance, ready to be used. </returns> public static DecoratorDrawerDrawer Create([NotNull]PropertyAttribute attribute, [NotNull]Type drawerType, [CanBeNull]IParentDrawer parent) { DecoratorDrawerDrawer result; if(!DrawerPool.TryGet(out result)) { result = new DecoratorDrawerDrawer(); } result.Setup(attribute, drawerType, null, parent); result.LateSetup(); return result; }
/// <inheritdoc /> public virtual bool ShowInInspector([NotNull] Type containingClassType, [CanBeNull] object containingClassInstance, [CanBeNull] MemberInfo classMember) { var targetedDrawer = DecoratorDrawerDrawer.GetTargetClassMemberDrawer(this); return(targetedDrawer == null ? true : targetedDrawer.ShouldShowInInspector); }