Skip to content

Instantly share code, notes, and snippets.

@Cameron-D
Created July 15, 2011 13:21
Show Gist options
  • Save Cameron-D/1084659 to your computer and use it in GitHub Desktop.
Save Cameron-D/1084659 to your computer and use it in GitHub Desktop.
class Derp {
private System.ComponentModel.BackgroundWorker backgroundWorker;
public Derp() {
backgroundWorker = new System.ComponentModel.BackgroundWorker();
this.backgroundWorker.DoWork += new System.ComponentModel.DoWorkEventHandler(this.backgroundWorker_DoWork);
}
public void Herp(string message) {
backgroundWorker.RunWorkerAsync(message);
}
private void backgroundWorker1_DoWork(object sender, System.ComponentModel.DoWorkEventArgs e) {
System.Windows.MessageBox.Show((string)e.Argument);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment