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

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

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

--- trunk/libxmltv/Core/DataSourceBindable.cs	2013/03/13 17:03:18	138
+++ trunk/libxmltv/Core/DataSourceBindable.cs	2013/03/14 13:08:20	141
@@ -35,6 +35,19 @@
             public string ChannelId { get; internal set; }
             public string ChannelName { get; internal set; }
 
+            public override string ToString()
+            {
+                StringBuilder builder = new StringBuilder();
+                Type t = typeof(ChannelDefintion);
+                var props = t.GetProperties();
+                foreach (var prop in props)
+                {
+                    string name = prop.Name;
+                    object value = prop.GetValue(this, null);
+                    builder.AppendFormat("\t{0}: '{1}'", name, value == null ? "null" : value.ToString());
+                }
+                return builder.ToString();
+            }
             
         }
         //static private List<string> known_columns;
@@ -72,7 +85,8 @@
                 {
                     ChannelDefintion definition = new ChannelDefintion();
                     definition.ChannelId = t.Id;
-                    definition.ChannelName = t.MetaData[XMLTVConstants.Channels.ChannelDisplayName].FirstOrDefault().Value.ToString();                    
+                    definition.ChannelName = t.MetaData[XMLTVConstants.Channels.ChannelDisplayName].FirstOrDefault().Value.ToString();
+                    xmltv_logger.Verbose.Debug.WriteLine(definition.ToString());
                     list.Add(definition);
                 }
                 catch (Exception ex) { throw ex; }
@@ -175,8 +189,8 @@
                 //ChannelId = string.Empty;
                 ChannelNumber = 0;
                 ChannelName = string.Empty;
-                Start = new DateTime();
-                Stop = new DateTime();
+                Start = new DateTime().ToDateTimeString();
+                Stop = new DateTime().ToDateTimeString();
                 Description = string.Empty;
                 Title = string.Empty;
                 SubTitle = string.Empty;
@@ -184,12 +198,25 @@
             //public string ChannelId { get; internal set; }
             public int ChannelNumber { get; internal set; }
             public string ChannelName { get; internal set; }
-            public DateTime Start { get; internal set; }
-            public DateTime Stop { get; internal set; }
+            public string Start { get; internal set; }
+            public string Stop { get; internal set; }
             public string Title { get; internal set; }
             public string SubTitle { get; internal set; }
             public string Description { get; internal set; }
 
+            public override string ToString()
+            {
+                StringBuilder builder = new StringBuilder();
+                Type t = typeof(ProgramDefintion);
+                var props = t.GetProperties();
+                foreach (var prop in props)
+                {
+                    string name = prop.Name;
+                    object value = prop.GetValue(this, null);
+                    builder.AppendFormat("\t{0}: '{1}'", name, value == null ? "null" : value.ToString());
+                }
+                return builder.ToString();
+            }
           
         }
         public ProgramList() { }
@@ -241,11 +268,13 @@
                     {
                         definition.ChannelNumber = 0;
                     }
-                    definition.Start = (DateTime)t.MetaData[XMLTVConstants.Programs.ProgramStart];
-                    definition.Stop = (DateTime)t.MetaData[XMLTVConstants.Programs.ProgramStop];
+                    definition.Start = ((DateTime)t.MetaData[XMLTVConstants.Programs.ProgramStart]).ToDateTimeString();
+                    definition.Stop = ((DateTime)t.MetaData[XMLTVConstants.Programs.ProgramStop]).ToDateTimeString();
                     definition.Description = t.MetaData[XMLTVConstants.Programs.ProgramDescription].ToString();
                     definition.Title = t.MetaData[XMLTVConstants.Programs.ProgramTitle].ToString();
                     definition.SubTitle = t.MetaData[XMLTVConstants.Programs.ProgramSubTitle].ToString();
+
+                    xmltv_logger.Verbose.Debug.WriteLine(definition.ToString());
                     list.Add(definition);
                 }
                 catch (Exception ex) { throw ex; }

 

  ViewVC Help
Powered by ViewVC 1.1.22