/// <summary>
 /// Initializes a new instance of the <see cref="T:EpgListingsImporter"/> class.
 /// </summary>
 /// <param name="results">The results.</param>
 public EpgListingsImporter(SchedulesDirect.SoapEntities.DownloadResults results)
 {
     this._results = results;
 }
 protected virtual void Dispose(bool disposing)
 {
     if (disposing)
      {
      ClearCache();
      if (this._results != null)
         this._results = null;
      }
 }
        /// <summary>
        /// Transforms the results from XML nodes to DownloadResults entity.
        /// </summary>
        /// <param name="xmlNodes">The XML nodes.</param>
        /// <returns>a DownloadResults entity</returns>
        private SchedulesDirect.SoapEntities.DownloadResults TransformResults(XmlNode[] xmlNodes)
        {
            SchedulesDirect.SoapEntities.DownloadResults downloadResults = new SchedulesDirect.SoapEntities.DownloadResults();

              if (xmlNodes == null)
            return downloadResults;

              foreach (XmlNode node in xmlNodes)
              {
            switch (node.Name)
            {
              case "messages":
            downloadResults._messages = new List<string>();
            foreach (string msg in node.InnerText.Trim().Split('\n'))
            {
              if (msg.StartsWith("Your subscription will expire:"))
              {
                DateTime.TryParse(msg.Substring(31), out downloadResults._subscriptionExpiration);
              }
              else if (!string.IsNullOrEmpty(msg))
              {
                downloadResults._messages.Add(msg.Trim());
              }
            }
            break;
              case "xtvd":
            XmlSerializer serializer = new XmlSerializer(typeof(SchedulesDirect.SoapEntities.XTVD));
            downloadResults._data = (SchedulesDirect.SoapEntities.XTVD)serializer.Deserialize(new XmlNodeReader(node));
            break;
            }
              }
              return downloadResults;
        }