Exemplo n.º 1
0
        private void ApplyBranchFilter(bool refresh)
        {
            if (_applyingFilter)
            {
                return;
            }

            _applyingFilter = true;
            try
            {
                string filter = _NO_TRANSLATE_toolStripBranches.Items.Count > 0 ? _NO_TRANSLATE_toolStripBranches.Text : string.Empty;

                if (filter == Strings.NoResultsFound)
                {
                    filter = string.Empty;
                }

                bool success = _NO_TRANSLATE_RevisionGrid.SetAndApplyBranchFilter(filter);
                if (success && refresh)
                {
                    _NO_TRANSLATE_RevisionGrid.ForceRefreshRevisions();
                }
            }
            finally
            {
                _applyingFilter = false;
            }
        }
Exemplo n.º 2
0
        private void ApplyFilter()
        {
            string revListArgs;
            string inMemMessageFilter;
            string inMemCommitterFilter;
            string inMemAuthorFilter;

            try
            {
                _NO_TRANSLATE_revisionGrid.FormatQuickFilter(
                    _NO_TRANSLATE_textBox.Text,
                    _commitFilterToolStripMenuItem.Checked,
                    _committerToolStripMenuItem.Checked,
                    _authorToolStripMenuItem.Checked,
                    _diffContainsToolStripMenuItem.Checked,
                    out revListArgs,
                    out inMemMessageFilter,
                    out inMemCommitterFilter,
                    out inMemAuthorFilter);
            }
            catch (InvalidOperationException ex)
            {
                MessageBox.Show(_NO_TRANSLATE_form, ex.Message, "Filter error");
                _NO_TRANSLATE_textBox.Text = "";
                return;
            }

            if ((_NO_TRANSLATE_revisionGrid.QuickRevisionFilter == revListArgs) &&
                (_NO_TRANSLATE_revisionGrid.InMemMessageFilter == inMemMessageFilter) &&
                (_NO_TRANSLATE_revisionGrid.InMemCommitterFilter == inMemCommitterFilter) &&
                (_NO_TRANSLATE_revisionGrid.InMemAuthorFilter == inMemAuthorFilter) &&
                _NO_TRANSLATE_revisionGrid.InMemFilterIgnoreCase)
            {
                return;
            }

            _NO_TRANSLATE_revisionGrid.QuickRevisionFilter   = revListArgs;
            _NO_TRANSLATE_revisionGrid.InMemMessageFilter    = inMemMessageFilter;
            _NO_TRANSLATE_revisionGrid.InMemCommitterFilter  = inMemCommitterFilter;
            _NO_TRANSLATE_revisionGrid.InMemAuthorFilter     = inMemAuthorFilter;
            _NO_TRANSLATE_revisionGrid.InMemFilterIgnoreCase = true;
            _NO_TRANSLATE_revisionGrid.Visible = true;
            _NO_TRANSLATE_revisionGrid.ForceRefreshRevisions();
        }