Пример #1
0
        private void BtnFindAllClick(object sender, EventArgs e)
        {
            if (string.IsNullOrEmpty(m_cmbFindWhat.Text))
            {
                return;
            }

            // Add item to shared list
            SledFindAndReplaceSettings.GlobalFindWhat.Add(m_cmbFindWhat.Text);

            // Re-add the history of items including the new item
            m_cmbFindWhat.Items.Clear();
            m_cmbFindWhat.Items.AddRange(SledFindAndReplaceSettings.GlobalFindWhat.Items);

            if (FindAndReplaceEvent == null)
            {
                return;
            }

            var lookIn = SledFindAndReplaceLookIn.Invalid;

            if (m_cmbLookIn.SelectedItem != null)
            {
                lookIn = (SledFindAndReplaceLookIn)((SledFindAndReplaceForm.TextAssociation)m_cmbLookIn.SelectedItem).Tag;
            }

            var searchType = SledFindAndReplaceSearchType.Normal;

            if ((m_cmbUse.SelectedItem != null) && (m_chkUse.Checked))
            {
                searchType = (SledFindAndReplaceSearchType)((SledFindAndReplaceForm.TextAssociation)m_cmbUse.SelectedItem).Tag;
            }

            var ea = new SledFindAndReplaceEventArgs.FindInFiles(
                m_cmbFindWhat.Text,
                lookIn,
                m_lstLookInFolders.ToArray(),
                m_chkIncludeSubFolders.Checked,
                lookIn != SledFindAndReplaceLookIn.Custom ? null : GetExtensions(),
                m_chkMatchCase.Checked,
                m_chkMatchWholeWord.Checked,
                searchType,
                m_rdoFindResults1Window.Checked);

            FindAndReplaceEvent(this, ea);
        }
        private void BtnFindAllClick(object sender, EventArgs e)
        {
            if (string.IsNullOrEmpty(m_cmbFindWhat.Text))
                return;

            // Add item to shared list
            SledFindAndReplaceSettings.GlobalFindWhat.Add(m_cmbFindWhat.Text);

            // Re-add the history of items including the new item
            m_cmbFindWhat.Items.Clear();
            m_cmbFindWhat.Items.AddRange(SledFindAndReplaceSettings.GlobalFindWhat.Items);

            if (FindAndReplaceEvent == null)
                return;

            var lookIn = SledFindAndReplaceLookIn.Invalid;
            if (m_cmbLookIn.SelectedItem != null)
                lookIn = (SledFindAndReplaceLookIn)((SledFindAndReplaceForm.TextAssociation)m_cmbLookIn.SelectedItem).Tag;

            var searchType = SledFindAndReplaceSearchType.Normal;
            if ((m_cmbUse.SelectedItem != null) && (m_chkUse.Checked))
                searchType = (SledFindAndReplaceSearchType)((SledFindAndReplaceForm.TextAssociation)m_cmbUse.SelectedItem).Tag;

            var ea = new SledFindAndReplaceEventArgs.FindInFiles(
                m_cmbFindWhat.Text,
                lookIn,
                m_lstLookInFolders.ToArray(),
                m_chkIncludeSubFolders.Checked,
                lookIn != SledFindAndReplaceLookIn.Custom ? null : GetExtensions(),
                m_chkMatchCase.Checked,
                m_chkMatchWholeWord.Checked,
                searchType,
                m_rdoFindResults1Window.Checked);

            FindAndReplaceEvent(this, ea);
        }