示例#1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="aceOperationArgs"/> class.
        /// </summary>
        /// <param name="__executor">The executor.</param>
        /// <param name="__menu">The menu.</param>
        /// <param name="__item">The item.</param>
        /// <param name="__method">The method.</param>
        /// <param name="__component">The component.</param>
        public aceOperationArgs(aceOperationSetExecutorBase __executor, aceMenuItemCollection __menu, aceMenuItem __item, MethodInfo __method, IAceComponent __component = null)
        {
            _executor     = __executor;
            _menu         = __menu;
            _item         = __item;
            _method       = __method;
            _component    = __component;
            _itemMetaData = new aceMenuItemMeta(_method);

            _methodInfo = new settingsMemberInfoEntry(_method);

            _item.deployMeta(_itemMetaData, this);
            _paramSet = itemMetaData.cmdParams;
        }
示例#2
0
        protected void renderMenuItems(aceMenuItemCollection items, menuRenderFlag renderFlags, aceMenuItemGroup group = aceMenuItemGroup.none)
        {
            if (items == null)
            {
                //aceCommons.terminal.log("------ renderMenuItems called -"
                //return;
            }
            String inlineOutput = "";

            var itemsOnPage = pageManager.getPageElements(items);


            foreach (aceMenuItem item in itemsOnPage)
            {
                if ((group == aceMenuItemGroup.none) || item.group == group)
                {
                    Boolean isDisabled = items.isDisabled(item);
                    Boolean isSelected = items.isSelected(item);
                    Boolean isDefault  = items.isDefault(item);
                    String  itemString = renderItem(item, renderFlags, isDisabled, isSelected, isDefault);

                    if (renderFlags.HasFlag(menuRenderFlag.listItems))
                    {
                        writeLine(itemString, -1, false, 1);

                        //output.Add(itemString);
                    }
                    else
                    {
                        inlineOutput = inlineOutput.add(itemString, " ");
                    }
                    //output.appendLine(renderItem(item, renderFlags, isDisabled, isSelected, isDefault));
                }
            }

            if (renderFlags.HasFlag(menuRenderFlag.inlineItems))
            {
                insertLine(inlineOutput);
            }

            //return output;
        }