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; } }
public FormOptions(CkernelGateway in_krnGateway) { InitializeComponent(); krnGateway=in_krnGateway; tabPageKernel.Selected = true; m_Globalize(); m_AddToolTip(); m_ApplySkin(); m_GetLanguageFiles(); if (Directory.Exists(Application.StartupPath+Path.DirectorySeparatorChar+"skins\\")) { string[] dirs = Directory.GetDirectories(Application.StartupPath+Path.DirectorySeparatorChar+"skins\\"); foreach (string folderName in dirs) { if (File.Exists(folderName+"\\skin.xml")) comboBoxSkin.Items.Add(Path.GetFileName(folderName)); } } DisplayPreferences(krnGateway.GetConfig()); m_DisplayInterfacePreferences(); }