private void OnWorkerLogChanged(object sender, LogChangedArgs e) { //cross thread - so you don't get the cross theading exception if (this.InvokeRequired) { this.BeginInvoke((MethodInvoker)delegate { OnWorkerLogChanged(sender, e); }); return; } //change control WriteToConsole(e.Log); }
protected void OnLogChanged(LogChangedArgs e) { if (LogChanged != null) { LogChanged(this, e); } }