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

            if (temp != null)
            {
                temp(this, new TaskEndArgs(taskInfo));
            }
        }
Exemple #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);
        }
Exemple #3
0
	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);
	}
Exemple #4
0
 public TaskEndArgs(DownloadTaskInfo taskInfo)
 {
     m_taskInfo = taskInfo;
 }
Exemple #5
0
		protected void RaiseTaskEndEvent(DownloadTaskInfo taskInfo)
		{
			EventHandler<TaskEndArgs> temp = Interlocked.CompareExchange(ref TaskEndEvent, null, null);
			if (temp != null)
				temp(this, new TaskEndArgs(taskInfo));
		}
Exemple #6
0
			public TaskEndArgs(DownloadTaskInfo taskInfo)
			{
				m_taskInfo = taskInfo;
			}
Exemple #7
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;
		}