private void btnExport_Click(object sender, EventArgs e) { rbMessage.Clear(); exportTask = new DataExporter(); exportTask.RunAsync(@"c:\\TestDataFile.txt"); exportTask.ProgressChanged += new ProgressChangedEventHandler(delegate(object o, ProgressChangedEventArgs args) { if (args != null && args.UserState != null) { this.rbMessage.AppendText(args.UserState.ToString()); } }); exportTask.Completed += new AsyncCompletedEventHandler(delegate(object o, AsyncCompletedEventArgs args) { this.rbMessage.AppendText("Export Successfuly."); }); }
private void btnExport_Click(object sender, EventArgs e) { rbMessage.Clear(); exportTask = new DataExporter(); exportTask.RunAsync(@"c:\\TestDataFile.txt"); exportTask.ProgressChanged += new ProgressChangedEventHandler(delegate(object o, ProgressChangedEventArgs args) { if (args != null && args.UserState != null) { this.rbMessage.AppendText(args.UserState.ToString()); } }); exportTask.Completed += new AsyncCompletedEventHandler(delegate(object o, AsyncCompletedEventArgs args) { this.rbMessage.AppendText("Export Successfuly."); }); }