コード例 #1
0
        protected void RaiseTaskEndEvent(DownloadTaskInfo taskInfo)
        {
            EventHandler <TaskEndArgs> temp = Interlocked.CompareExchange(ref TaskEndEvent, null, null);

            if (temp != null)
            {
                temp(this, new TaskEndArgs(taskInfo));
            }
        }
コード例 #2
0
        /// <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);
        }
コード例 #3
0
 public TaskEndArgs(DownloadTaskInfo taskInfo)
 {
     m_taskInfo = taskInfo;
 }