예제 #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();
        }
예제 #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);
        }