void StartDownload(ModConfiguration config) { if (_log.IsDebugEnabled) { _log.DebugFormat("Starting {0}", MethodBase.GetCurrentMethod().ToString()); } ModManagement.Downloaded += new EventHandler <System.ComponentModel.AsyncCompletedEventArgs>(ModManagement_Downloaded); ModManagement.DownloadFailed += new EventHandler <System.ComponentModel.AsyncCompletedEventArgs>(ModManagement_DownloadFailed); ModManagement.StartDownload(config); if (_log.IsDebugEnabled) { _log.DebugFormat("Ending {0}", MethodBase.GetCurrentMethod().ToString()); } }
private void TestAllDownloads() { TestConfigs = new List <ModConfiguration>(); foreach (ModConfiguration config in ModManagement.GetPredefinedMods().Values) { if (config.ID != DataStrings.StockID) { if (!string.IsNullOrEmpty(config.Download.Source)) { if (ModManagement.StartDownload(config)) { TestConfigs.Add(config); } } } } //ModManagement.Downloaded -= new EventHandler<System.ComponentModel.AsyncCompletedEventArgs>(ModManagement_Downloaded); //ModManagement.DownloadFailed -= new EventHandler<System.ComponentModel.AsyncCompletedEventArgs>(ModManagement_DownloadFailed); }