示例#1
0
        public static bool StartTask(this ThunderTask task)
        {
            bool result = StartTask(task.ID);

            task.IsStart = result;
            task.IsStop  = false;
            return(result);
        }
示例#2
0
        public bool DeleteTask(ThunderTask task, bool deletefile = false)
        {
            bool result = ThunderDll.DeleteTask(task.ID);

            if (deletefile)
            {
                ThunderDll.DelTempFile(task.Param);
            }

            Tasks.TryRemove(task.URL, out _);
            return(result);
        }
示例#3
0
        public ThunderTask CreateTask(string url, string savefile)
        {
            if (Tasks.ContainsKey(url))
            {
                return(Tasks[url]);
            }

            ThunderTask task = new ThunderTask(url, savefile);

            task.ID = ThunderDll.CreateTask(task.Param);
            Tasks.TryAdd(url, task);
            return(task);
        }
示例#4
0
 public static bool StopTask(this ThunderTask task)
 {
     return(StopTask(task.ID));
 }