ADBaseLibrary.DownloadManager.CheckForDownload C# (CSharp) Метод

CheckForDownload() приватный Метод

private CheckForDownload ( ) : void
Результат void
        private void CheckForDownload()
        {
            bool change = false;
            lock (_downloadslock)
            {
                int cnt = _downloads.Count(a => a.Status == DownloadStatus.Downloading);
                List<DownloadItem> infos =_downloads.Where(a => a.Status == DownloadStatus.Queue).OrderBy(a => a.Index).ToList();
                if (cnt < MaxDownloads && (infos.Count > 0))
                {
                    int max = MaxDownloads - cnt;
                    if (max > infos.Count)
                        max = infos.Count;
                    for (int x = 0; x < max; x++)
                    {
                        infos[x].Start();
                        change = true;
                    }
                }
            }
            if (change)
               Save();
        }