void manifest_Complete(object sender, Net.AssetDownloader.Asset.CompleteEventArgs e) { var asset = (Net.AssetDownloader.Asset)sender; var c = e.GetCache(); using (c) { if (c != null && c.HasData) { if (asset.type == Net.AssetDownloader.Asset.AssetType.File) { try { c.SetPositionToContent(); AddFilesFromManifest(c, baseIds); Create404Manifest(asset.fileId); } catch (Exception ex) { Util.Logging.Log(ex); } } bool isComplete; lock (this) { progress.manifestsDownloaded++; progress.contentBytesCore += e.ContentLength; isComplete = progress.manifestsDownloaded == progress.manifestsTotal; } if (isComplete) { OnManifestsComplete(); } } else { lock (this) { if (progress.errored) { return; } progress.errored = true; } if (Error != null) { Error(this, "Failed to retieve manifests", null); } } } }
void manifestUnused_Complete(object sender, Net.AssetDownloader.Asset.CompleteEventArgs e) { manifest_Complete(sender, e, false); }
void file_Complete(object sender, Net.AssetDownloader.Asset.CompleteEventArgs e) { lock (this) progress.filesDownloaded++; }