예제 #1
0
 private void Start()
 {
     if (queue.Count > 0)
     {
         currentTask = queue.Dequeue();
         currentTask.Start();
     }
 }
예제 #2
0
 /// <summary>
 ///  如果报错 上层代码调用clear 再创建新的
 /// </summary>
 public void Dispose()
 {
     while (queue.Count > 0)
     {
         DownLoadTask task = queue.Dequeue();
         task.Dispose();
     }
     queue = null;
 }
예제 #3
0
 public void DownLoadFiles(UrlDiskPath[] paths, Action complete, Action <float> progress, Action <string> error)
 {
     this.complete  = complete;
     this.progress  = progress;
     this.error     = error;
     this.taskCount = paths.Length;
     for (int i = 0; i < paths.Length; i++)
     {
         DownLoadTask task = new DownLoadTask(i, "Task" + i, paths[i], TaskProgress, TaskComplete, TaskError);
         queue.Enqueue(task);
     }
     Start();
 }