Exemplo n.º 1
0
        private void myContextMenuPopup(object sender, System.EventArgs e)
        {
            ContextMenuSearch.MenuItems[0].DefaultItem = true;
            MenuInfo.OnMenuInfoChange();

            if (SelectedItems.Count == 0)
            {
                ContextMenuSearch.MenuItems[0].Enabled = false;
                ContextMenuSearch.MenuItems[1].Enabled = false;
                ContextMenuSearch.MenuItems[3].Enabled = false;
                ContextMenuSearch.MenuItems[4].Enabled = false;
                ContextMenuSearch.MenuItems[6].Enabled = false;
            }

            if (SelectedItems.Count == 1)
            {
                ContextMenuSearch.MenuItems[0].Enabled = true;
                ContextMenuSearch.MenuItems[0].Enabled = true;
                ContextMenuSearch.MenuItems[3].Enabled = true;
                ContextMenuSearch.MenuItems[4].Enabled = true;
                ContextMenuSearch.MenuItems[6].Enabled = true;
            }
            if (SelectedItems.Count > 1)
            {
                ContextMenuSearch.MenuItems[0].Enabled = true;
                ContextMenuSearch.MenuItems[1].Enabled = true;
                ContextMenuSearch.MenuItems[3].Enabled = false;
                ContextMenuSearch.MenuItems[4].Enabled = false;
                ContextMenuSearch.MenuItems[6].Enabled = false;
            }
        }
Exemplo n.º 2
0
        private void myContextMenuPopup(object sender, System.EventArgs e)
        {
            m_config = krnGateway.GetConfig();
            ContextMenuShared.MenuItems[0].DefaultItem = true;
            m_CheckPriority();
            MenuInfo.OnMenuInfoChange();

            if (SelectedItems.Count == 0)
            {
                ContextMenuShared.MenuItems[0].Enabled = false;
                ContextMenuShared.MenuItems[1].Enabled = false;
                ContextMenuShared.MenuItems[3].Enabled = false;
                ContextMenuShared.MenuItems[4].Enabled = false;
                ContextMenuShared.MenuItems[5].Enabled = false;
                ContextMenuShared.MenuItems[7].Enabled = false;
                ContextMenuShared.MenuItems[9].Enabled = false;
                PriorityMenu.MenuItems[0].Enabled      = false;
                PriorityMenu.MenuItems[1].Enabled      = false;
                PriorityMenu.MenuItems[2].Enabled      = false;
                PriorityMenu.MenuItems[3].Enabled      = false;
                PriorityMenu.MenuItems[4].Enabled      = false;
            }
            if (SelectedItems.Count == 1)
            {
                ContextMenuShared.MenuItems[0].Enabled = m_IsCompleted();
                ContextMenuShared.MenuItems[1].Enabled = m_IsCompleted();
                ContextMenuShared.MenuItems[3].Enabled = true;
                ContextMenuShared.MenuItems[4].Enabled = true;
                ContextMenuShared.MenuItems[5].Enabled = m_config.IsHighID;
                ContextMenuShared.MenuItems[7].Enabled = true;
                ContextMenuShared.MenuItems[9].Enabled = true;
                PriorityMenu.MenuItems[0].Enabled      = true;
                PriorityMenu.MenuItems[1].Enabled      = true;
                PriorityMenu.MenuItems[2].Enabled      = true;
                PriorityMenu.MenuItems[3].Enabled      = true;
                PriorityMenu.MenuItems[4].Enabled      = true;
            }

            if (SelectedItems.Count > 1)
            {
                ContextMenuShared.MenuItems[0].Enabled = false;
                ContextMenuShared.MenuItems[1].Enabled = true;
                ContextMenuShared.MenuItems[3].Enabled = false;
                ContextMenuShared.MenuItems[4].Enabled = false;
                ContextMenuShared.MenuItems[5].Enabled = false;
                ContextMenuShared.MenuItems[7].Enabled = true;
                ContextMenuShared.MenuItems[9].Enabled = false;
                PriorityMenu.MenuItems[0].Enabled      = true;
                PriorityMenu.MenuItems[1].Enabled      = true;
                PriorityMenu.MenuItems[2].Enabled      = true;
                PriorityMenu.MenuItems[3].Enabled      = true;
                PriorityMenu.MenuItems[4].Enabled      = true;
            }
        }