Borodar.ReorderableList.ReorderableListControl.AddItemsToMenu C# (CSharp) Метод

AddItemsToMenu() защищенный Метод

Invoked to generate context menu for list item.
protected AddItemsToMenu ( GenericMenu menu, int itemIndex, IReorderableListAdaptor adaptor ) : void
menu UnityEditor.GenericMenu Menu which can be populated.
itemIndex int Zero-based index of item which was right-clicked.
adaptor IReorderableListAdaptor Reorderable list adaptor.
Результат void
        protected virtual void AddItemsToMenu(GenericMenu menu, int itemIndex, IReorderableListAdaptor adaptor)
        {
            if ((Flags & ReorderableListFlags.DisableReordering) == 0) {
                if (itemIndex > 0)
                    menu.AddItem(CommandMoveToTop, false, DefaultContextHandler, CommandMoveToTop);
                else
                    menu.AddDisabledItem(CommandMoveToTop);

                if (itemIndex + 1 < adaptor.Count)
                    menu.AddItem(CommandMoveToBottom, false, DefaultContextHandler, CommandMoveToBottom);
                else
                    menu.AddDisabledItem(CommandMoveToBottom);

                if (HasAddButton) {
                    menu.AddSeparator("");

                    menu.AddItem(CommandInsertAbove, false, DefaultContextHandler, CommandInsertAbove);
                    menu.AddItem(CommandInsertBelow, false, DefaultContextHandler, CommandInsertBelow);

                    if ((Flags & ReorderableListFlags.DisableDuplicateCommand) == 0)
                        menu.AddItem(CommandDuplicate, false, DefaultContextHandler, CommandDuplicate);
                }
            }

            if (HasRemoveButtons) {
                if (menu.GetItemCount() > 0)
                    menu.AddSeparator("");

                menu.AddItem(CommandRemove, false, DefaultContextHandler, CommandRemove);
                menu.AddSeparator("");
                menu.AddItem(CommandClearAll, false, DefaultContextHandler, CommandClearAll);
            }
        }