public void Download(OnlineScriptViewModel toDownload, Dispatcher dispatcher, Action<Iron7Server.SimpleScriptDetail> successfulAction) { this.successfulAction = successfulAction; this.toDownload = toDownload; this.dispatcher = dispatcher; childWindow = new Views.StyledChildWindow(); var backgroundThread = new System.Threading.Thread(DownloadProc); backgroundThread.Start(); childWindow.Closed += (sender, args) => { cancelRequested = true; try { if (myRequest != null) myRequest.Abort(); } catch { // ignore problems :/ } }; childWindow.Show("copying script " + toDownload.Title); childWindow.ShowCancelButton(); }
public void Upload(AccountViewModel account, ItemViewModel toUpload, Dispatcher dispatcher) { this.account = account; this.toUpload = toUpload; this.dispatcher = dispatcher; childWindow = new Views.StyledChildWindow(); var backgroundThread = new System.Threading.Thread(UploadProc); backgroundThread.Start(); childWindow.Closed += (sender, args) => { cancelRequested = true; try { if (myRequest != null) myRequest.Abort(); } catch { // ignore problems :/ } }; childWindow.Show("uploading script '" + toUpload.Title + "'"); childWindow.ShowCancelButton(); }