public DownloaderItem CreateDownloaderItem() { var item = new DownloaderItem() { DateFromDesired = DateTime.ParseExact(DateFrom, "yyyy-MM-dd", CultureInfo.InvariantCulture), DateToDesired = DateTime.ParseExact(DateTo, "yyyy-MM-dd", CultureInfo.InvariantCulture) }; if (Source == "Ducascopy") { item.Symbol = new DucascopySymbol() { Name = Instrument, DirectoryName = Instrument }; } if (Source == "Pse") { item.Symbol = new PseSymbol() { Name = Instrument }; } return(item); }
/// <summary> /// Download the downloadURL file to CurrentDir\UpdateFiles\update.zip /// </summary> /// <param name="downloadURL">The url of the file to download</param> /// <param name="updateInfo">The description of the file</param> private bool InternalDownload(string downloadURL, string updateInfo = "") { DownloaderItem dlItem = new DownloaderItem() { DownloadUrl = downloadURL, UpdateInfo = updateInfo }; Downloader downloader = new Downloader(dlItem); downloader.ShowDialog(owner); if (downloader.downloadItem.Complete) { return(true); } else { return(false); } }