コード例 #1
0
 protected virtual void OnTextFound(TextFoundEventArgs e)
 {
     if (TextFound != null)
     {
         TextFound(this, e);
     }
 }
コード例 #2
0
 public void Execute(string target)
 {
     using (StreamReader sr = new StreamReader(_filename)) {
         string line;
         while ((line = sr.ReadLine()) != null)
         {
             if (line.TrimStart().StartsWith(target))
             {
                 TextFoundEventArgs e = new TextFoundEventArgs(line);
                 OnTextFound(e);
             }
         }
     }
 }
コード例 #3
0
 static void tf_TextFound(object sender, TextFoundEventArgs e)
 {
     Console.WriteLine(e.Line);
 }