private void m_cmMappings_Popup(object sender, EventArgs e)
{
// Uncheck all the menu items (currently only one).
foreach (MenuItem menu in m_cmMappings.MenuItems)
{
menu.Checked = false;
menu.Enabled = true;
}
if (m_lvCurrentMappingList.SelectedItems.Count > 1)
{
// Go through the selected items and remove mappings whose marker
// is the chapter or verse marker.
foreach (ListViewItem item in m_lvCurrentMappingList.SelectedItems)
{
if (item.Text == "\\c" || item.Text == "\\v")
item.Selected = false;
}
}
// Disable all the menu items when there are no selected mappings or
// the ones there are, are for the chapter or verse marker.
if (m_lvCurrentMappingList.SelectedItems.Count == 0 ||
(m_lvCurrentMappingList.SelectedItems.Count == 1 &&
(m_lvCurrentMappingList.SelectedItems[0].Text == "\\c" ||
m_lvCurrentMappingList.SelectedItems[0].Text == "\\v")))
{
foreach (MenuItem menu in m_cmMappings.MenuItems)
menu.Enabled = false;
return;
}
}