/[xmltv_parser]/trunk/xmltv_parser/main.cs
ViewVC logotype

Diff of /trunk/xmltv_parser/main.cs

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

--- trunk/xmltv_parser/main.cs	2013/03/09 12:46:38	85
+++ trunk/xmltv_parser/main.cs	2013/03/09 13:51:58	86
@@ -150,7 +150,7 @@
             if (instance != null)
             {
                 var program_count = instance.Programs.Count;
-                var program_list = instance.Programs.ToList().OrderBy(s => s.Start);
+                var program_list = instance.Programs.ToList().OrderBy(s => s.GetProperty(XMLTVConstants.Programs.ProgramStart).ToString());
                 //Programs = program_list(0, program_count).ToList();
                 Programs = new List<IXMLTVProgram>(program_list.ToArray());
             }
@@ -176,13 +176,17 @@
             List<ListViewItem> items = new List<ListViewItem>();
             foreach (var program in Programs)
             {
-                ListViewItem li = new ListViewItem(string.Format("{0} {1}", program.Channel.Number, program.Channel.CallSign));
+                IXMLTVChannel Channel = null;
+                var instance = XMLTV.GetInstance();
+                var id = program.GetProperty(XMLTVConstants.Programs.ProgramChannelId).ToString();
+                Channel = instance.Channels.Find(m => m.Id == id);
+                ListViewItem li = new ListViewItem(string.Format("{0} {1}", Channel.Number, Channel.CallSign));
                 li.Tag = program;
-                li.SubItems.Add(new ListViewItem.ListViewSubItem(li, program.Title));
-                li.SubItems.Add(new ListViewItem.ListViewSubItem(li, program.SubTitle));
-                li.SubItems.Add(new ListViewItem.ListViewSubItem(li, program.Description));
-                li.SubItems.Add(new ListViewItem.ListViewSubItem(li, program.Start.ToString("yyyy/MM/dd hh:mm tt")));
-                li.SubItems.Add(new ListViewItem.ListViewSubItem(li, program.Stop.ToString("yyyy/MM/dd hh:mm tt")));
+                li.SubItems.Add(new ListViewItem.ListViewSubItem(li, program.GetProperty(XMLTVConstants.Programs.ProgramTitle).ToString()));
+                li.SubItems.Add(new ListViewItem.ListViewSubItem(li, program.GetProperty(XMLTVConstants.Programs.ProgramSubTitle).ToString()));
+                li.SubItems.Add(new ListViewItem.ListViewSubItem(li, program.GetProperty(XMLTVConstants.Programs.ProgramDescription).ToString()));
+                li.SubItems.Add(new ListViewItem.ListViewSubItem(li, ((DateTime)program.GetProperty(XMLTVConstants.Programs.ProgramStart)).ToString("yyyy/MM/dd hh:mm tt")));
+                li.SubItems.Add(new ListViewItem.ListViewSubItem(li, ((DateTime)program.GetProperty(XMLTVConstants.Programs.ProgramStop)).ToString("yyyy/MM/dd hh:mm tt")));
                 //lstPrograms.Items.Add(li);
                 items.Add(li);
             }

 

  ViewVC Help
Powered by ViewVC 1.1.22