Пример #1
0
        /// <summary>
        /// Updates the state of a tool strip item.
        /// </summary>
        /// <param name="item">The item to update.</param>
        void UpdateItem(MenuItem item)
        {
            NuGenApplicationCommand applicationCommand = _commandManager.GetApplicationCommandByItem(item);

            if (applicationCommand != null)
            {
                Control ownerControl = GetOwnerControl(item);
                applicationCommand.Update(ownerControl, item);

                foreach (MenuItem childItem in item.MenuItems)
                {
                    UpdateItem(childItem);
                }
            }
        }
Пример #2
0
        /// <summary>
        /// Updates the state of a tool strip item.
        /// </summary>
        /// <param name="item">The item to update.</param>
        void UpdateItem(ToolStripItem item)
        {
            NuGenApplicationCommand applicationCommand = _commandManager.GetApplicationCommandByItem(item);

            if (applicationCommand != null)
            {
                Control ownerControl = GetOwnerControl(item);
                applicationCommand.Update(ownerControl, item);

                ToolStripDropDownItem dropDownItem = item as ToolStripDropDownItem;
                if (dropDownItem != null)
                {
                    foreach (ToolStripItem childItem in dropDownItem.DropDownItems)
                    {
                        UpdateItem(childItem);
                    }
                }
            }
        }