protected void RaiseTaskEndEvent(DownloadTaskInfo taskInfo) { EventHandler <TaskEndArgs> temp = Interlocked.CompareExchange(ref TaskEndEvent, null, null); if (temp != null) { temp(this, new TaskEndArgs(taskInfo)); } }
/// <summary> /// find task by md5 /// </summary> /// <param name="md5"></param> /// <param name="info">receive task info</param> /// <returns>return true when found</returns> public Boolean FindTask(String md5, out DownloadTaskInfo info) { lock (m_lock) { Task task; if (m_taskMap.TryGetValue(md5, out task)) { info = task.ToDownloadTaskInfo(); return(true); } } info = new DownloadTaskInfo(); return(false); }
public Boolean GetDownloadingInfo(String packId, out Downloader.DownloadTaskInfo downloadInfo) { ExpansionPackInfo packInfo; if (!FindPackInfo(packId, out packInfo)) { downloadInfo = new Downloader.DownloadTaskInfo(); return false; } return m_downloadManager.FindTask(packInfo.md5, out downloadInfo); }
public TaskEndArgs(DownloadTaskInfo taskInfo) { m_taskInfo = taskInfo; }
protected void RaiseTaskEndEvent(DownloadTaskInfo taskInfo) { EventHandler<TaskEndArgs> temp = Interlocked.CompareExchange(ref TaskEndEvent, null, null); if (temp != null) temp(this, new TaskEndArgs(taskInfo)); }
/// <summary> /// find task by md5 /// </summary> /// <param name="md5"></param> /// <param name="info">receive task info</param> /// <returns>return true when found</returns> public Boolean FindTask(String md5, out DownloadTaskInfo info) { lock (m_lock) { Task task; if (m_taskMap.TryGetValue(md5, out task)) { info = task.ToDownloadTaskInfo(); return true; } } info = new DownloadTaskInfo(); return false; }