private void contextMenu_Opening(object sender, CancelEventArgs e)
{
try
{
contextmenu_initialising = true;
contextMenu.SuspendLayout();
FromStatusTextBox.Text = "";
fillInMenuItems(fromStatusToolStripMenuItem, status_filters, new EventHandler(FromStatusTextBox_TextChanged), new KeyPressEventHandler(FromStatusTextBox_KeyPress));
FromSeverityTextBox.Text = "";
fillInMenuItems(fromSeverityToolStripMenuItem, severity_filters, new EventHandler(FromSeverityTextBox_TextChanged), new KeyPressEventHandler(FromSeverityTextBox_KeyPress));
FromCreatedTextBox.Text = "";
fillInMenuItems(fromCreatedToolStripMenuItem, created_filters, new EventHandler(FromCreatedTextBox_TextChanged), new KeyPressEventHandler(FromCreatedTextBox_KeyPress));
FromSummaryTextBox.Text = "";
fillInMenuItems(fromSummaryToolStripMenuItem, summary_filters, new EventHandler(FromSummaryTextBox_TextChanged), new KeyPressEventHandler(FromSummaryTextBox_KeyPress));
filterOutToolStripMenuItem.Checked = (status_filters.Count > 0 || severity_filters.Count > 0 || created_filters.Count > 0 || summary_filters.Count > 0);
allClosedItemsToolStripMenuItem.Checked = (status_filters.Contains("closed") && status_filters.Contains("fixed") && status_filters.Contains("wontfix"));
allNotSeriousToolStripMenuItem.Checked = (severity_filters.Contains("target") && severity_filters.Contains("wishlist") && severity_filters.Contains("minor"));
if (!contextmenu_fixupclosing)
{ // Hack in such that any attempts to auto-close the filter menu are prevented
filterOutToolStripMenuItem.DropDown.Closing += new ToolStripDropDownClosingEventHandler(filterOutToolStripMenuItem_Closing);
fromStatusToolStripMenuItem.DropDown.Closing += new ToolStripDropDownClosingEventHandler(filterOutToolStripMenuItem_Closing);
fromSeverityToolStripMenuItem.DropDown.Closing += new ToolStripDropDownClosingEventHandler(filterOutToolStripMenuItem_Closing);
fromCreatedToolStripMenuItem.DropDown.Closing += new ToolStripDropDownClosingEventHandler(filterOutToolStripMenuItem_Closing);
fromSummaryToolStripMenuItem.DropDown.Closing += new ToolStripDropDownClosingEventHandler(filterOutToolStripMenuItem_Closing);
contextmenu_fixupclosing = true;
}
}
finally
{
contextMenu.ResumeLayout();
contextmenu_initialising = false;
}
}