private async Task CreateTask(string gid, string link, TaskType type)
        {
            var newTask = await GetTask(gid);

            newTask.Link     = link;
            newTask.TaskType = type;
            Add(newTask);
            DownloadTasks.Add(newTask);
        }
        public async Task Delete(string gid)
        {
            var task = DownloadTask(gid);

            if (task == null)
            {
                return;
            }

            await DeleteAsync(task);

            DownloadTasks.RemoveAll(p => p.GID == task.GID);
        }
예제 #3
0
        // Protected implementation of Dispose pattern.
        protected virtual void Dispose(bool disposing)
        {
            if (disposed)
            {
                return;
            }

            if (disposing)
            {
                DownloadTasks.Clear();
                API = null;

                // Free any other managed objects here.
                //
            }

            // Free any unmanaged objects here.
            //
            disposed = true;
        }