private void TransferCompleted(object sender, AsyncCompletedEventArgs e) { if (e.Cancelled) { this.Progress = "Cancelled"; this.SubItems["speed"].Text = ""; return; } if (e.Error != null) { this.Progress = "Error"; this.SubItems["speed"].Text = ""; return; } this.Progress = "Finished"; this.SubItems["speed"].Text = ""; this.Status = "finished"; QueueForm queueForm = this.GetForm(); queueForm.Start(new object(), new EventArgs()); queueForm.UpdateStatus(); }
private void ShowQueueForm() { // if queueForm is never been showed or is closed, generate it again if (queueForm == null || queueForm.IsDisposed) { queueForm = new QueueForm(this); } queueForm.Show(); if (queueForm.WindowState == FormWindowState.Minimized) { queueForm.WindowState = queueForm.GetLastWindowState(); } queueForm.BringToFront(); System.Windows.Forms.Application.DoEvents(); }
public void Start() { if (this.Status == "running") { return; } this.Status = "running"; this.Progress = "Connecting..."; QueueForm form = this.GetForm(); if (this.Direction == "upload") { HubicSignature signature = form.HAPI.GetSignature(this.Container, this.RemotePath, this.LocalPath); //this.wc = form.OSAPI.UploadObject(this.Container, this.RemotePath, this.LocalPath, signature.signature, signature.maxFileSize, signature.expires, this.UploadProgressChanged, this.TransferCompleted); form.OSAPI.UploadObject(this.Container, this.RemotePath + "/", this.LocalPath, signature.signature, signature.maxFileSize, signature.expires, this.TransferProgressChanged, this.TransferCompleted); } else if (this.Direction == "download") { this.wc = form.OSAPI.DownloadObject(this.Container, this.RemotePath, this.LocalPath, this.DownloadProgressChanged, this.TransferCompleted); } }
private void Queue(object sender, EventArgs e) { var form = new QueueForm(); form.Show(); }