private void PrepareData(DownloadWizardArgs args) { try { var links = this.GetLinks(args); args.Links = links; var sizes = this.GetSizes(links, args.Cookies); Assert.IsTrue(sizes.Count == args.Links.Count, "The length of the sizes array differs from links count"); Assert.IsTrue(sizes.All(s => s.Value > 0), "Some SDN packages are said to have 0 length"); args.Sizes = sizes; } catch (Exception ex) { Log.Error("Error while preparing data", this, ex); } }
private Exception PrepareData(DownloadWizardArgs args) { try { var links = this.GetLinks(args); args.Links = links; var sizes = this.GetSizes(links, args.Cookies); Assert.IsTrue(sizes.Count == args.Links.Count, "The length of the sizes array differs from links count"); Assert.IsTrue(sizes.All(s => s.Value > 0), "Some SDN packages are said to have 0 length"); args.Sizes = sizes; } catch (Exception ex) { return(ex); } return(null); }
private ReadOnlyCollection <Uri> GetLinks(DownloadWizardArgs args) { return(new ReadOnlyCollection <Uri>(args.Products.SelectMany(product => product.Value).ToArray())); }
private void PrepareData(DownloadWizardArgs args) { try { var links = this.GetLinks(args); args.Links = links; var sizes = this.GetSizes(links, args.Cookies); Assert.IsTrue(sizes.Count == args.Links.Count, "The length of the sizes array differs from links count"); Assert.IsTrue(sizes.All(s => s.Value > 0), "Some SDN packages are said to have 0 length"); args.Sizes = sizes; } catch (Exception ex) { Log.Error(ex, "Error while preparing data"); } }
private ReadOnlyCollection<Uri> GetLinks(DownloadWizardArgs args) { return new ReadOnlyCollection<Uri>(args.Products.SelectMany(product => product.Value).ToArray()); }