private void OnRequestFinished(MvxNativeFileDownloadRequest request)
 {
     this.RunSyncOrAsyncWithLock(() =>
     {
         this.currentRequests.Remove(request);
         if (this.queuedRequests.Any())
         {
             this.StartNextQueuedItem();
         }
     });
 }
        public void RequestDownload(string url, string downloadPath, Action success, Action <Exception> error)
        {
            var request = new MvxNativeFileDownloadRequest(url, downloadPath);

            request.DownloadComplete += (sender, args) =>
            {
                this.OnRequestFinished(request);
                success();
            };
            request.DownloadFailed += (sender, args) =>
            {
                this.OnRequestFinished(request);
                error(args.Value);
            };

            this.RunSyncOrAsyncWithLock(() =>
            {
                this.queuedRequests.Enqueue(request);
                if (this.currentRequests.Count < this.maxConcurrentDownloads)
                {
                    this.StartNextQueuedItem();
                }
            });
        }