private void Signature_MouseDown(object sender, MouseEventArgs e) { Filter filter; if (sender is Filter) { filter = sender as Filter; Point newLocation = new Point(e.Location.X + filter.Location.X + Filters.Location.X, e.Location.Y + filter.Location.Y + Filters.Location.Y); FilterClick(sender); FilterMenu.Show(this.PointToScreen(newLocation)); } }
private void FilterBtn_Click(object sender, EventArgs e) { int SeparatorIdx = FilterMenu.Items.IndexOf(FilterMenu_Separator); while (FilterMenu.Items.Count > SeparatorIdx + 1) { FilterMenu.Items.RemoveAt(SeparatorIdx + 1); } FilterMenu_ShowAll.Checked = (FilterName == null); if (CustomFilters.Count > 0) { foreach (KeyValuePair <string, Func <IssueData, bool> > CustomFilter in CustomFilters.OrderBy(x => x.Key)) { ToolStripMenuItem Item = new ToolStripMenuItem(CustomFilter.Key); Item.Checked = (FilterName == CustomFilter.Key); Item.Click += (S, E) => { FilterName = CustomFilter.Key; UpdateIssueList(); }; FilterMenu.Items.Add(Item); } } HashSet <string> Streams = new HashSet <string>(StringComparer.OrdinalIgnoreCase); foreach (IssueData Issue in Issues) { if (Issue.Streams != null) { Streams.UnionWith(Issue.Streams); } } if (Streams.Count > 0) { FilterMenu.Items.Add(new ToolStripSeparator()); foreach (string Stream in Streams.OrderBy(x => x)) { ToolStripMenuItem Item = new ToolStripMenuItem(Stream); Item.Checked = (FilterName == Stream); Item.Click += (S, E) => { FilterName = Stream; UpdateIssueList(); }; FilterMenu.Items.Add(Item); } } FilterMenu.Show(FilterBtn, new Point(FilterBtn.Left, FilterBtn.Bottom)); }
private void FilterBtn_Click(object sender, EventArgs e) { int SeparatorIdx = FilterMenu.Items.IndexOf(FilterMenu_Separator); while (FilterMenu.Items.Count > SeparatorIdx + 1) { FilterMenu.Items.RemoveAt(SeparatorIdx + 1); } FilterMenu_ShowAll.Checked = (FilterProjectName == null); foreach (string ProjectName in ProjectNames) { ToolStripMenuItem Item = new ToolStripMenuItem(ProjectName); Item.Checked = (FilterProjectName == ProjectName); Item.Click += (S, E) => { FilterProjectName = ProjectName; UpdateIssueList(); }; FilterMenu.Items.Add(Item); } FilterMenu.Show(FilterBtn, new Point(FilterBtn.Left, FilterBtn.Bottom)); }