/[xmltv_parser]/trunk/libxmltv/Core/XMLTVProgramCollection.cs
ViewVC logotype

Diff of /trunk/libxmltv/Core/XMLTVProgramCollection.cs

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

--- trunk/libxmltv/Core/XMLTVProgramCollection.cs	2013/03/08 03:01:48	42
+++ trunk/libxmltv/Core/XMLTVProgramCollection.cs	2013/03/08 03:09:49	43
@@ -5,6 +5,7 @@
 using libxmltv.Interfaces;
 using System.Xml.Linq;
 using System.Globalization;
+using System.Windows.Forms;
 
 namespace libxmltv.Core
 {
@@ -50,17 +51,17 @@
                 Program program = new Program();
 
                 program.Id = index;
-                //XMLTV_LOGGER.Log.Verbose.Debug.WriteLine("program_Id: {0}", program.Id);
+                XMLTV_LOGGER.Log.Verbose.Debug.WriteLine("program_Id: {0}", program.Id);
                 if (c.HasAttributes)
                 {
                     var start = c.Attribute(XMLTVConstants.Programs.ProgramStart).Value;
                     program.Start = ParseDate(start);
-                    //XMLTV_LOGGER.Log.Verbose.Debug.WriteLine("\tprogram_start: {0}", start);
+                    XMLTV_LOGGER.Log.Verbose.Debug.WriteLine("\tprogram_start: {0}", start);
                     var stop = c.Attribute(XMLTVConstants.Programs.ProgramStop).Value;
                     program.Stop = ParseDate(stop);
-                    //XMLTV_LOGGER.Log.Verbose.Debug.WriteLine("\tprogram_stop: {0}", stop);
+                    XMLTV_LOGGER.Log.Verbose.Debug.WriteLine("\tprogram_stop: {0}", stop);
                     var channelid = c.Attribute(XMLTVConstants.Programs.ProgramChannelId).Value;
-                    //XMLTV_LOGGER.Log.Verbose.Debug.WriteLine("\tprogram_channelid: {0}", channelid);
+                    XMLTV_LOGGER.Log.Verbose.Debug.WriteLine("\tprogram_channelid: {0}", channelid);
                     IXMLTVChannel channel = new Channel();
                     try
                     {
@@ -71,7 +72,7 @@
                         XMLTV_LOGGER.Log.Verbose.Error.WriteLine(string.Format("Unable to find Channel by id: '{0}' for this program.", channelid));
                     }
                     program.Channel = channel;
-                    //XMLTV_LOGGER.Log.Verbose.Debug.WriteLine("\tprogram_channel: {0}", program.Channel.ToString());
+                    XMLTV_LOGGER.Log.Verbose.Debug.WriteLine("\tprogram_channel: {0}", program.Channel.ToString());
                 }
                 try
                 {
@@ -79,29 +80,30 @@
                     program.Title = title;                    
                 }
                 catch (Exception) { program.Title = string.Empty; }
-                //XMLTV_LOGGER.Log.Verbose.Debug.WriteLine("\tprogram_title: {0}", program.Title == string.Empty ? "empty" : program.Title);
+                XMLTV_LOGGER.Log.Verbose.Debug.WriteLine("\tprogram_title: {0}", program.Title == string.Empty ? "empty" : program.Title);
                 try
                 {
                     var subtitle = c.Descendants(XMLTVConstants.Programs.ProgramSubTitle).FirstOrDefault().Value;
                     program.SubTitle = subtitle;                    
                 }
                 catch (Exception) { program.SubTitle = string.Empty; }
-                //XMLTV_LOGGER.Log.Verbose.Debug.WriteLine("\tprogram_subtitle: {0}", program.SubTitle == string.Empty ? "empty" : program.SubTitle);
+                XMLTV_LOGGER.Log.Verbose.Debug.WriteLine("\tprogram_subtitle: {0}", program.SubTitle == string.Empty ? "empty" : program.SubTitle);
                 try
                 {
                     var description = c.Descendants(XMLTVConstants.Programs.ProgramDescription).FirstOrDefault().Value;
                     program.Description = description;                    
                 }
                 catch (Exception) { program.Description = string.Empty; }
-                //XMLTV_LOGGER.Log.Verbose.Debug.WriteLine("\tprogram_description: {0}", program.Description == string.Empty ? "empty" : program.Description);
+                XMLTV_LOGGER.Log.Verbose.Debug.WriteLine("\tprogram_description: {0}", program.Description == string.Empty ? "empty" : program.Description);
 
                 entries.Add(program.Id, program);
+                Application.DoEvents();
                 index++;
             }
         }
         public override string ToString()
         {
-            //return string.Format("XmlTv Source: '{0}' (Generated by: '{1}') (support: '{2}')", SourceName, GeneratorName, GeneratorUrl);
+            return string.Format("Program Count: {0}", Collection == null ? 0 : Collection.Count);
             return string.Empty;
         }
     }

 

  ViewVC Help
Powered by ViewVC 1.1.22