public void SingleDownload() { // Force log4net on. // BasicConfigurator.Configure(); // LogManager.GetRepository().Threshold = Level.Debug; log.Info("Performing single download test."); // We know kOS is in the TestKAN data, and hosted in KS. Let's get it. var modules = new List <CkanModule>(); CkanModule kOS = registry.LatestAvailable("kOS", null); Assert.IsNotNull(kOS); modules.Add(kOS); // Make sure we don't alread have kOS somehow. Assert.IsFalse(cache.IsCached(kOS.download)); // log.InfoFormat("Downloading kOS from {0}", kOS.download); // Download our module. async.DownloadModules( ksp.KSP.Cache, modules ); // Assert that we have it, and it passes zip validation. Assert.IsTrue(cache.IsCachedZip(kOS.download)); }
/// <summary> /// Makes sure all the specified mods are downloaded. /// </summary> private void DownloadModules(IEnumerable <CkanModule> mods, NetAsyncDownloader downloader) { List <CkanModule> downloads = mods.Where(module => !ksp.Cache.IsCachedZip(module.download)).ToList(); if (downloads.Count > 0) { downloader.DownloadModules(ksp.Cache, downloads); } }
private void CacheMod(object sender, DoWorkEventArgs e) { ResetProgress(); ClearLog(); NetAsyncDownloader dowloader = new NetAsyncDownloader(m_User); dowloader.DownloadModules(CurrentInstance.Cache, new List <CkanModule> { (CkanModule)e.Argument }); e.Result = e.Argument; }
private void CacheMod(object sender, DoWorkEventArgs e) { ResetProgress(); ClearLog(); NetAsyncDownloader dowloader = new NetAsyncDownloader(m_User); dowloader.DownloadModules(CurrentInstance.Cache, new List<CkanModule> { (CkanModule)e.Argument }); e.Result = e.Argument; }
/// <summary> /// Makes sure all the specified mods are downloaded. /// </summary> private void DownloadModules(IEnumerable<CkanModule> mods, NetAsyncDownloader downloader) { List<CkanModule> downloads = mods.Where(module => !ksp.Cache.IsCachedZip(module.download)).ToList(); if (downloads.Count > 0) { downloader.DownloadModules(ksp.Cache, downloads); } }