/// <summary> /// Protected void raises the <see cref="FoundItem"/> event /// </summary> /// <param name="Text">Containing the text portion of the found match</param> /// <param name="Line">Containing the line number where the text was found</param> protected virtual void OnFoundItem(string Text, int Line) { if (FoundItem != null) { FoundItemEventArgs evtFound = new FoundItemEventArgs(Text, Line); FoundItem(this, evtFound); } }
void Search_FoundItem(object sender, FoundItemEventArgs e) { try { ls.Add(new lists() { Line = e.Line, Word = e.Text }); } catch (Exception ex) { MessageBox.Show(ex.StackTrace); } // MessageBox.Show(e.Text); }