Exemple #1
0
        private void hsSeach_Click(object sender, EventArgs e)
        {
            AutocompleteSample();
            var srch = @"^.*\b(" + txtSearchCode.Text + @")\b.*$";

            _findlst         = fctSource.FindLines(srch, RegexOptions.Multiline);
            _aktSelectedLine = 0;
            cbFoundLines.Items.Clear();
            if (_findlst.Count <= 0)
            {
                return;
            }

            var n = 0;

            foreach (var ln in _findlst)
            {
                var so = new CbSearchObject
                {
                    LineIndex = n++,
                    Line      = ln + 1,
                    Text      = fctSource.Lines[ln].Trim()
                };
                cbFoundLines.Items.Add(so);
            }

            cbFoundLines.SelectedIndex = cbFoundLines.Items.Count > 0 ? 0 : -1;
            hsSearchDown.Enabled       = true;
            hsSearchUp.Enabled         = true;
            _aktSelectedLine           = 0;
            SelectLine(_aktSelectedLine);
        }
Exemple #2
0
        private void SearchReverseResults()
        {
            AutocompleteSample();
            var srch = @"^.*\b(" + txtSearchCodeReverse.Text + @")\b.*$";

            _findlstReverse         = fctSourceReverse.FindLines(srch, RegexOptions.Multiline);
            _aktSelectedLineReverse = 0;
            cbFoundLinesReverse.Items.Clear();
            if (_findlstReverse.Count <= 0)
            {
                return;
            }

            var n = 0;

            foreach (var ln in _findlstReverse)
            {
                var so = new CbSearchObject
                {
                    LineIndex = n++,
                    Line      = ln + 1,
                    Text      = fctSourceReverse.Lines[ln].Trim()
                };
                cbFoundLinesReverse.Items.Add(so);
            }

            cbFoundLinesReverse.SelectedIndex = cbFoundLinesReverse.Items.Count > 0 ? 0 : -1;
            hsSearchDownReverse.Enabled       = true;
            hsSearchUpReverse.Enabled         = true;
            _aktSelectedLineReverse           = 0;
            SelectLineReverse(_aktSelectedLineReverse);
        }