protected virtual void OnLogCommentFound(CommentEventArgs e) { EventHandler<CommentEventArgs> handler = LogCommentFound; if (handler != null) { handler(this, e); } }
void core_LogCommentFound(object sender, CommentEventArgs e) { Action a = delegate() { string comment = string.Format("[{0}] {1}", TimeSpan.FromMilliseconds(e.Timestamp).ToString("hh\\:mm\\:ss"), e.Text); lstComments.Items.Add(comment); labelLastActivityMessage.Text = comment; }; Invoke(a); }