public static bool StartTask(this ThunderTask task) { bool result = StartTask(task.ID); task.IsStart = result; task.IsStop = false; return(result); }
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); }
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); }
public static bool StopTask(this ThunderTask task) { return(StopTask(task.ID)); }