Ejemplo n.º 1
0
 public Worker(DownloadTask task, DownloadRange range)
 {
     this.task = task;
     this.range = range;
     this.done = false;
     this.stream = new MemoryStream();
     id = System.Guid.NewGuid().ToString();
 }
Ejemplo n.º 2
0
 public Task createTask(string url, string dir, string fileName)
 {
     DownloadTask task = new DownloadTask(url, dir, fileName);
     task.setStatus(TaskStatus.Waiting);
     task.onTaskStatusChanged += this.OnTaskStatusChanged;
     task.id = currId+"";
     currId++;
     lock(lockObj){
         waittingTasks.Add(task);
         allTasks.Add(task);
     }
     return task;
 }