public SA_StorageWorker Verify(Job job) { SA_StorageWorker saStorageWorker = new SA_StorageWorker(job); saStorageWorker.DoWork += new DoWorkEventHandler(this.bw_Verify_DoWork); return saStorageWorker; }
public SA_StorageWorker Transfer(Job job, Storage destination) { SA_StorageWorker saStorageWorker; if (destination is LocalStorage) { saStorageWorker = new SA_StorageWorker(job); saStorageWorker.DoWork += new DoWorkEventHandler(this.bw_Transfer_DoWork); } else { saStorageWorker = new SA_StorageWorker(job); saStorageWorker.DoWork += new DoWorkEventHandler(destination.bw_Transfer_DoWork); } return saStorageWorker; }
private void SetCurrentWorker(SA_StorageWorker bw_NewWorker) { this.busy = true; if (!this.sleeping) this.Log.PrepareEntry(); if (this.bw_CurrentWorker != null && !this.bw_CurrentWorker.IsBusy) this.bw_CurrentWorker.Dispose(); if (bw_NewWorker == null) return; this.bw_CurrentWorker = bw_NewWorker; this.bw_CurrentWorker.ProgressChanged += new ProgressChangedEventHandler(this.CurrentWorkerProgressChanged); this.bw_CurrentWorker.RunWorkerCompleted += new RunWorkerCompletedEventHandler(this.CurrentWorkerCompleted); this.bw_CurrentWorker.RunWorkerAsync(); }
public SA_StorageWorker Approve(Job job) { SA_StorageWorker saStorageWorker = new SA_StorageWorker(job); saStorageWorker.DoWork += new DoWorkEventHandler(this.bw_Finalize_DoWork); return saStorageWorker; }
private void reTry(RetryDelegate retryAction) { if (this.sleeping) { this.sleeping = false; retryAction.DynamicInvoke(new object[0]); } else { this.sleeping = true; SA_StorageWorker bw_NewWorker = new SA_StorageWorker(this); bw_NewWorker.DoWork += new DoWorkEventHandler(this.bw_Sleep_DoWork); this.SetCurrentWorker(bw_NewWorker); } }