/// <summary> /// Sets the visibility of a renderer based on the attribute [Visibility]. /// If VisibilityAttribute parameters id and value are not null, and the object with the id 'id' /// has the value 'value', then the renderer holding the attribute is visible, otherwise it is not display in the inspector. /// If method is not empty, then if the class where the visibility attribute is used has this function and this function return true, /// the renderer will be rendered. /// </summary> public static VisibilitySetter GetVisibilitySetter(InspectorItemRenderer renderer, FullObjectRenderer contextRenderer) { object caller = null; object classFieldBelongTo = null; FullObjectRenderer.GetContextualObjects(renderer, contextRenderer, out caller, out classFieldBelongTo); return(new VisibilitySetter(renderer, caller, classFieldBelongTo, contextRenderer.renderers.ToArray())); }
//// <summary> /// Gets the message renderer for <c>InspectorItemRenderer</c> with the attribute MessageAttribute. /// </summary> /// <returns>The message renderer created to render MessageAttribute in the inspector.</returns> /// <param name="renderer">An item renderer.</param> /// <param name="contextRenderer">The context in which the renderer is rendered.</param> public static MessageRenderer[] GetMessageRenderers(InspectorItemRenderer renderer, FullObjectRenderer contextRenderer) { List <MessageRenderer> result = new List <MessageRenderer>(); object caller = null; object classFieldBelongTo = null; FullObjectRenderer.GetContextualObjects(renderer, contextRenderer, out caller, out classFieldBelongTo); MessageAttribute[] messageAttributes = AttributeHelper.GetAttributes <MessageAttribute>(renderer.entityInfo); if (messageAttributes != null) { foreach (MessageAttribute messageAttribute in messageAttributes) { result.Add(new MessageRenderer(messageAttribute, caller, classFieldBelongTo, contextRenderer.renderers.ToArray())); } } return(result.ToArray()); }