Ejemplo n.º 1
0
        /// <inheritdoc/>
        public void Setup(IInspector inspectorContainingToolbar, IInspectorToolbar toolbarContainingItem, ToolbarItemAlignment alignment)
        {
            inspector    = inspectorContainingToolbar;
            toolbar      = toolbarContainingItem;
            bounds.width = 0f;
            Alignment    = alignment;

            Setup();
        }
Ejemplo n.º 2
0
 /// <inheritdoc/>
 protected override void SetupToolbar(IInspectorToolbar setupToolbar)
 {
     setupToolbar.Setup(this /*, OnBackButtonActivate, OnForwardButtonActivate, OnViewMenuButtonActivated*/);
 }
Ejemplo n.º 3
0
        public static IInspectorToolbarItem[] GetItemsForToolbar([NotNull] IInspector inspector, [NotNull] IInspectorToolbar toolbar)
        {
            if (toolbarItemsByToolbarType == null)
            {
                BuildDictionaries();
            }

            Type[] itemTypes;
            if (!toolbarItemsByToolbarType.TryGetValue(toolbar.GetType(), out itemTypes))
            {
                return(ArrayPool <IInspectorToolbarItem> .ZeroSizeArray);
            }

            int count = itemTypes.Length;

            IInspectorToolbarItem[] items = new IInspectorToolbarItem[count];
            for (int n = count - 1; n >= 0; n--)
            {
                var itemType  = itemTypes[n];
                var item      = (IInspectorToolbarItem)itemType.CreateInstance();
                var alignment = ((ToolbarItemForAttribute)itemType.GetCustomAttributes(typeof(ToolbarItemForAttribute), false)[0]).alignment;
                item.Setup(inspector, toolbar, alignment);
                items[n] = item;
            }

            return(items);
        }