예제 #1
0
 public override void RemoveEntry(Job job)
 {
     if (!File.Exists(this.filePath))
     return;
       string str1 = this.filePath + ((object) job.MD5).ToString() + Path.GetExtension(this.FilePath);
       TextReader textReader = (TextReader) File.OpenText(this.filePath);
       TextWriter textWriter = (TextWriter) File.CreateText(str1);
       string str2;
       while ((str2 = textReader.ReadLine()) != null)
       {
     if (str2.IndexOf(job.Name) == -1)
       textWriter.WriteLine(str2);
       }
       textWriter.Close();
       textReader.Close();
       File.Delete(this.filePath);
       File.Move(str1, this.filePath);
       if (new FileInfo(this.filePath).Length == 0L)
     this.CleanUp();
 }
예제 #2
0
 public SA_StorageWorker Verify(Job job)
 {
     SA_StorageWorker saStorageWorker = new SA_StorageWorker(job);
       saStorageWorker.DoWork += new DoWorkEventHandler(this.bw_Verify_DoWork);
       return saStorageWorker;
 }
예제 #3
0
 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;
 }
예제 #4
0
 public virtual void Delete(Job j)
 {
 }
예제 #5
0
 public SA_StorageWorker Approve(Job job)
 {
     SA_StorageWorker saStorageWorker = new SA_StorageWorker(job);
       saStorageWorker.DoWork += new DoWorkEventHandler(this.bw_Finalize_DoWork);
       return saStorageWorker;
 }
예제 #6
0
 public SA_StorageWorker(Job job)
 {
     this.job = job;
       this.WorkerReportsProgress = true;
       this.WorkerSupportsCancellation = true;
 }
예제 #7
0
 public override void Delete(Job j)
 {
     BackgroundWorker backgroundWorker = new BackgroundWorker();
     backgroundWorker.DoWork += new DoWorkEventHandler(this.bw_Delete_DoWork);
     backgroundWorker.RunWorkerAsync((object)j);
 }
예제 #8
0
 public abstract void RemoveEntry(Job job);
예제 #9
0
 private void UpdateContent(Job j)
 {
     DataRow dataRow = this.Content.Rows.Find((object) j.UniqueID);
       if (dataRow == null)
       {
     this.Content.Rows.Add((object) j.UniqueID, (object) j, (object) j.FileName, (object) SA_Reflect.GetUIName((object) j.Status.TerseStatus), (object) j.Status.VerboseStatus, (object) j.Status.VisualStatusBadge);
       }
       else
       {
     object[] objArray = new object[6]
     {
       (object) j.UniqueID,
       (object) j,
       (object) j.FileName,
       (object) SA_Reflect.GetUIName((object) j.Status.TerseStatus),
       (object) j.Status.VerboseStatus,
       (object) j.Status.VisualStatusBadge
     };
     dataRow.ItemArray = objArray;
       }
       if (this.Status.TerseStatus != SessionStatus.Started)
     return;
       this.Status.CurrentQuantity = 0L;
       List<Job> list = new List<Job>();
       list.AddRange((IEnumerable<Job>) this.jobsFinishedSuccesfully);
       list.AddRange((IEnumerable<Job>) this.jobsFinishedWithComments);
       list.AddRange((IEnumerable<Job>) this.jobsFinishedWithError);
       foreach (Job job in list)
       {
     SA_SessionStatus status = this.Status;
     long num = status.CurrentQuantity + job.Status.TargetQuantity;
     status.CurrentQuantity = num;
       }
       foreach (Job job in (Collection<Job>) this.jobsTransferring)
       {
     SA_SessionStatus status = this.Status;
     long num = status.CurrentQuantity + job.Status.CurrentQuantity;
     status.CurrentQuantity = num;
       }
 }