public override List<Show> Grab(string xmlParameters, ILogger logger)
 {
     var shows = new List<Show>();
     var doc = XDocument.Parse(xmlParameters);
     var sdElement = doc.Descendants("StartDate").FirstOrDefault();
     var startDateDiff = sdElement != null && sdElement.Value != null ? Convert.ToInt32(sdElement.Value) : -1;
     var edElement = doc.Descendants("EndDate").FirstOrDefault();
     var endDateDays = edElement != null && edElement.Value != null ? Convert.ToInt32(edElement.Value) : 3;
     for (int i = startDateDiff; i < endDateDays; i++)
     {
         var p = new GrabParameters() { Date = DateTime.Now.Date.AddDays(i) };
         shows.AddRange(Grab(p, logger));
     }
     return shows;
 }
Exemple #2
0
        public override List <Show> Grab(string xmlParameters, ILogger logger)
        {
            var shows         = new List <Show>();
            var doc           = XDocument.Parse(xmlParameters);
            var sdElement     = doc.Descendants("StartDate").FirstOrDefault();
            var startDateDiff = sdElement != null && sdElement.Value != null?Convert.ToInt32(sdElement.Value) : -1;

            var edElement   = doc.Descendants("EndDate").FirstOrDefault();
            var endDateDays = edElement != null && edElement.Value != null?Convert.ToInt32(edElement.Value) : 3;

            for (int i = startDateDiff; i < endDateDays; i++)
            {
                var p = new GrabParameters()
                {
                    Date = DateTime.Now.Date.AddDays(i)
                };
                shows.AddRange(Grab(p, logger));
            }
            return(shows);
        }