void OnDownloadComplete(string filename) { EventHandler <downloadCompleteEventArgs> temp = downloadComplete; if (temp != null) { downloadCompleteEventArgs e = new downloadCompleteEventArgs(); e.filename = filename; context.Post(delegate(object state) { downloadComplete(this, e); }, null); } }
void ftpobject_downloadComplete(object sender, downloadCompleteEventArgs e) { progressBar.Style = ProgressBarStyle.Blocks; statusBar.Text = "Скачка завершена: " + e.filename + Environment.NewLine + statusBar.Text; refreshLocal(); }