Exemple #1
0
        /// <summary>
        /// 加入下載結果監控器
        /// </summary>
        /// <returns>下載結果監控器(DownloadMonitor)</returns>
        /// <param name="commands">要監控的下載命令陣列,當這些命令全部執行完畢,則會回傳結果</param>
        /// <param name="resultHandler">處理下載結果的函式</param>
        public DownloadMonitor AddDownloadMonitor(List <DownloadCommand> commands, Action <DownloadMonitorResult> resultHandler)
        {
            DownloadMonitor monitor = new DownloadMonitor(commands, resultHandler);

            monitorList.Add(monitor);
            return(monitor);
        }
Exemple #2
0
 /// <summary>
 /// 停止監控下載進度
 /// </summary>
 public void StopMonitor(DownloadMonitor monitor)
 {
     if (monitorList.Contains(monitor))
     {
         monitor.Stop();
         monitorList.Remove(monitor);
     }
 }