示例#1
0
 public void FindTextAll(string textToSearch)
 {
     try
     {
         if (string.IsNullOrEmpty(textToSearch))
         {
             return;
         }
         var        searchInFileCriteria  = new SearchInFileCriteria(textToSearch);
         var        searchInFileLineItems = new List <SearchInFileLineItem>();
         List <int> findLines             = fastColoredTextBox1.FindLines(textToSearch, RegexOptions.IgnoreCase | RegexOptions.Singleline);
         foreach (int findLine in findLines)
         {
             var searchInFileLineItem = new SearchInFileLineItem();
             searchInFileLineItem.TextLine             = fastColoredTextBox1.Lines[findLine].Trim();
             searchInFileLineItem.LineNum              = findLine;
             searchInFileLineItem.SearchInFileCriteria = searchInFileCriteria;
             searchInFileLineItems.Add(searchInFileLineItem);
         }
         FindInSourcePanel.SetFindInFileResult(searchInFileLineItems);
     }
     catch (Exception ex)
     {
     }
 }
示例#2
0
        private void NavigateToLineInSource(SearchInFileLineItem searchInFileLineItem)
        {
            var doc = MainForm.ActiveMdiChild as SourceContainerDocument;

            doc.SourceEditorPanel.NavigateToSourceLine(searchInFileLineItem.LineNum);
        }