コード例 #1
0
        private void btnApply_Click(object sender, EventArgs e)
        {
            try
            {
                if (chkRemoveDups.Checked)
                {
                    RemoveDuplicates();
                }

                _list.Clear();

                _list.AddRange(_destListBox);

                bool does    = (chkContains.Checked && !string.IsNullOrEmpty(txtContains.Text));
                bool doesnot = (chkNotContains.Checked && !string.IsNullOrEmpty(txtDoesNotContain.Text));

                if (lbRemove.Items.Count > 0)
                {
                    FilterList();
                }

                if (does || doesnot)
                {
                    FilterMatches(does, doesnot);
                }

                if (_destListBox.Items.Count > 0 && _destListBox.Items[0] is Article)
                {
                    FilterNamespace();
                }

                if (_list.Count != _destListBox.Items.Count)
                {
                    _destListBox.BeginUpdate();
                    _destListBox.Items.Clear();
                    _destListBox.Items.AddRange(_list.ToArray());
                    _destListBox.EndUpdate();
                }

                if (chkSortAZ.Checked)
                {
                    _destListBox.Sort();
                }

                //Only try to update number of articles using listmaker method IF the parent is indeed a listmaker
                //Causes exception on DBScanner otherwise
                if (_destListBox.Parent is ListMaker)
                {
                    (_destListBox.Parent as ListMaker).UpdateNumberOfArticles();
                }
            }
            catch (Exception ex)
            {
                ErrorHandler.HandleException(ex);
            }
            DialogResult = DialogResult.OK;
        }
コード例 #2
0
        private void selectAllToolStripMenuItem_Click(object sender, EventArgs e)
        {
            ListBoxArticle selectedListBox = ActiveControl as ListBoxArticle;

            if (selectedListBox != null)
            {
                selectedListBox.BeginUpdate();

                // workaround for Wine issue: use of {HOME} then +{END} leads to 100% CPU and locked application
                // so use slower SetSelected if on Linux
                if (Globals.UsingLinux)
                {
                    for (int i = 0; i < selectedListBox.Items.Count; i++)
                    {
                        selectedListBox.SetSelected(i, true);
                    }
                }
                else
                {
                    SendKeys.SendWait("{HOME}");
                    SendKeys.SendWait("+{END}");
                }

                selectedListBox.EndUpdate();
            }
        }
コード例 #3
0
        private void selectAllToolStripMenuItem_Click(object sender, EventArgs e)
        {
            ListBoxArticle selectedListBox = this.ActiveControl as ListBoxArticle;

            if (selectedListBox != null)
            {
                selectedListBox.BeginUpdate();

                SendKeys.SendWait("{HOME}");
                SendKeys.SendWait("+{END}");

                selectedListBox.EndUpdate();
            }
        }