/// <summary>
 /// Adds the directory entry to internal list
 /// </summary>
 /// <param name="dir">DirectoryEntry</param>
 private void AddDirectoryEntryToList(DirectoryEntry dir)
 {
     lock (DownloaderList)
     {
         DownloaderList.Add(dir);
     }
 }
Esempio n. 2
0
 private void CheckDownloaderQuantity()
 {
     if (DownloaderList.Count > _maxDownloaderCount)
     {
         for (int i = 0; i < (DownloaderList.Count - _maxDownloaderCount); i++)
         {
             DownloaderList.Remove(DownloaderList[i]);
         }
     }
     else
     {
         int c = _maxDownloaderCount - DownloaderList.Count;
         for (int i = 0; i < c; i++)
         {
             DownloaderList.Add(new Downloader(this));
             Console.WriteLine(DownloaderList.Count());
         }
     }
 }