Beispiel #1
0
        static void Main(string[] args)
        {
            var reader      = new SingleLineReader(@"File location");
            var lineNumbers = reader.FindLineNumberAndPosition("exclaimer");

            foreach (var number in lineNumbers)
            {
                Console.WriteLine(number);
            }

            Console.ReadLine();
        }
Beispiel #2
0
        private void StartSearch(object sender, RoutedEventArgs e)
        {
            if (Words.AllWords.Count < 1)
            {
                MessageBox.Show("Please enter in some words (File > Search Words", "Please enter words",
                                MessageBoxButton.OK, MessageBoxImage.Stop);
            }

            foreach (var allWord in Words.AllWords.Where(allWord => !SearchWords.Word.Contains(allWord)))
            {
                SearchWords.Word.Add(allWord);
            }

            var slr     = new SingleLineReader(FilePath);
            var results = slr.FindTextInSingleFile(SearchWords);

            foreach (var result in results)
            {
                ViewModel.Records.Add(result);
            }
        }
Beispiel #3
0
 /// <summary>
 /// returns a copy of the line reader
 /// </summary>
 /// <returns></returns>
 public override object Clone()
 {
     SingleLineReader slr = new SingleLineReader(this.filename);
     return slr;
 }