public FilterRevisionsHelper(ToolStripTextBox textBox, ToolStripDropDownButton dropDownButton, RevisionGrid revisionGrid, ToolStripLabel label, ToolStripButton showFirstParentButton, Form form) { _commitFilterToolStripMenuItem = new ToolStripMenuItem { Checked = true, CheckOnClick = true, Name = "commitToolStripMenuItem1", Text = "Commit message and hash" }; _committerToolStripMenuItem = new ToolStripMenuItem { CheckOnClick = true, Name = "committerToolStripMenuItem", Text = "Committer" }; _authorToolStripMenuItem = new ToolStripMenuItem { CheckOnClick = true, Name = "authorToolStripMenuItem", Text = "Author" }; _diffContainsToolStripMenuItem = new ToolStripMenuItem { CheckOnClick = true, Name = "diffContainsToolStripMenuItem", Text = "Diff contains (SLOW)" }; _diffContainsToolStripMenuItem.Click += (sender, e) => { if (_diffContainsToolStripMenuItem.Checked) { _commitFilterToolStripMenuItem.Checked = false; _committerToolStripMenuItem.Checked = false; _authorToolStripMenuItem.Checked = false; _hashToolStripMenuItem.Checked = false; } else { _commitFilterToolStripMenuItem.Checked = true; } }; _hashToolStripMenuItem = new ToolStripMenuItem { CheckOnClick = true, Name = "hashToolStripMenuItem", Size = new System.Drawing.Size(216, 24), Text = "Hash" }; _NO_TRANSLATE_textBox = textBox; _NO_TRANSLATE_revisionGrid = revisionGrid; _NO_TRANSLATE_showFirstParentButton = showFirstParentButton; _NO_TRANSLATE_form = form; dropDownButton.DropDownItems.AddRange(new ToolStripItem[] { _commitFilterToolStripMenuItem, _committerToolStripMenuItem, _authorToolStripMenuItem, _diffContainsToolStripMenuItem }); _NO_TRANSLATE_showFirstParentButton.Checked = AppSettings.ShowFirstParent; label.Click += delegate { ApplyFilter(); }; _NO_TRANSLATE_textBox.Leave += delegate { ApplyFilter(); }; _NO_TRANSLATE_textBox.KeyPress += (sender, e) => { if (e.KeyChar == (char)Keys.Enter) { ApplyFilter(); } }; _NO_TRANSLATE_showFirstParentButton.Click += delegate { _NO_TRANSLATE_revisionGrid.ShowFirstParent(); }; _NO_TRANSLATE_revisionGrid.ShowFirstParentsToggled += delegate { _NO_TRANSLATE_showFirstParentButton.Checked = AppSettings.ShowFirstParent; }; }