public void executeOperation(Button btn, Label lbl, String url, IDownloadObserver observer) { mIDownloadObserver = observer; // if (!System.Net.NetworkInformation.NetworkInterface.GetIsNetworkAvailable()) { if (mIDownloadObserver != null) { mIDownloadObserver.onMessage(new DownloadArgument("NetworkFailed")); } return; } if (btn.Text == "Cancel") { btn.Text = "Download"; cancel(url); return; } FileDownloader fd = create(lbl, url, observer, btn); if (fd.DownloadStatus == "Continue") { return; } if (fd.DownloadStatus != "Completed") { fd.DownloadAsync(url, this); btn.Text = "Cancel"; btn.Enabled = true; } }
public FileDownloader exeute(Label lblProgress, String url, IDownloadObserver IDownloadObserver) { mIDownloadObserver = IDownloadObserver; // FileDownloader fd = new FileDownloader(lblProgress); this.Add(fd); fd.DownloadAsync(url, this); return(fd); }