/[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/10 19:22:06	122
+++ trunk/libxmltv/Core/DataSourceBindable.cs	2013/03/10 19:32:56	123
@@ -13,10 +13,10 @@
             public ChannelDefintion()
             {
                 ChannelId = string.Empty;
-                Name = string.Empty;
+                ChannelName = string.Empty;
             }
             public string ChannelId { get; internal set; }
-            public string Name { get; internal set; }
+            public string ChannelName { get; internal set; }
         }
         //static private List<string> known_columns;
         //static ChannelList()
@@ -40,11 +40,12 @@
                 {
                     ChannelDefintion definition = new ChannelDefintion();
                     definition.ChannelId = t.Id;
-                    definition.Name = t.MetaData[XMLTVConstants.Channels.ChannelDisplayName].FirstOrDefault().Value.ToString();                    
+                    definition.ChannelName = t.MetaData[XMLTVConstants.Channels.ChannelDisplayName].FirstOrDefault().Value.ToString();                    
                     list.Add(definition);
                 }
                 catch (Exception ex) { throw ex; }
             }
+            list = list.OrderBy(s => s.ChannelName).ToList();
             bindable = list;
             return bindable;
         }
@@ -55,7 +56,7 @@
         {
             public ProgramDefintion()
             {
-                ChannelId = string.Empty;
+                //ChannelId = string.Empty;
                 ChannelName = string.Empty;
                 Start = new DateTime();
                 Stop = new DateTime();
@@ -63,13 +64,13 @@
                 Title = string.Empty;
                 SubTitle = string.Empty;
             }
-            public string ChannelId { get; internal set; }
+            //public string ChannelId { get; internal set; }
             public string ChannelName { get; internal set; }
             public DateTime Start { get; internal set; }
             public DateTime Stop { get; internal set; }
-            public string Description { get; internal set; }
             public string Title { get; internal set; }
             public string SubTitle { get; internal set; }
+            public string Description { get; internal set; }    
         }
         public ProgramList() { }
 
@@ -83,12 +84,13 @@
                 try
                 {
                     ProgramDefintion definition = new ProgramDefintion();
-                    definition.ChannelId = t.MetaData[XMLTVConstants.Programs.ProgramChannelId].ToString();
+                    string ChannelId = t.MetaData[XMLTVConstants.Programs.ProgramChannelId].ToString();
+                    //definition.ChannelId = ChannelId;
 
                     var channels = XMLTV.GetChannels();
                     if (channels != null)
                     {
-                        var channel = channels.Find(p => p.Id == definition.ChannelId);
+                        var channel = channels.Find(p => p.Id == ChannelId);
                         if (channel != null)
                         {
                             definition.ChannelName = channel.MetaData[XMLTVConstants.Channels.ChannelDisplayName].FirstOrDefault().Value.ToString();
@@ -111,6 +113,9 @@
                 }
                 catch (Exception ex) { throw ex; }
             }
+
+            list = list.OrderBy(s => s.Start).ToList();
+
             bindable = list;
             return bindable;
         }

 

  ViewVC Help
Powered by ViewVC 1.1.22