/[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/08 13:57:42	60
+++ trunk/xmltv_parser/main.cs	2013/03/08 14:13:19	61
@@ -51,7 +51,7 @@
         private void gLog_ReportProgress(object sender, ReportProgressEventArgs e) { ReportProgress(e.Progress); }
 
         StringBuilder log_flusher = new StringBuilder();
-        
+
         void Log_OnFlush(object sender, LoggerOnFlushEventArgs e)
         {
             OnLogFlush(e.Buffer);
@@ -75,7 +75,7 @@
         }
 
         void UpdateStatus(string logmessage)
-        {            
+        {
             txtStatus.Text = logmessage.Replace(System.Environment.NewLine, "");
         }
         void UpdateLogOutput(string logmessage)
@@ -111,7 +111,7 @@
         {
             //XMLTV.CreateInstance(schedule_xml, new EventHandler<CancelEventArgs>(xmltv_cancelevent));
             XMLTV.CreateInstance(schedule_xml);
-            XMLTV.OnInstanceCreated += new EventHandler<EventArgs>(XMLTV_OnInstanceCreated);           
+            XMLTV.OnInstanceCreated += new EventHandler<EventArgs>(XMLTV_OnInstanceCreated);
         }
 
         void XMLTV_OnInstanceCreated(object sender, EventArgs e)
@@ -261,9 +261,36 @@
             if (program == null) { return; }
             txtStatus.Text = program.ToString();
             //gLog.Debug.WriteLine(program.ToString());
-            
+
         }
 
+        private void lstPrograms_ColumnClick(object sender, ColumnClickEventArgs e)
+        {
+            ListViewSorter Sorter = new ListViewSorter();
+            lstPrograms.ListViewItemSorter = Sorter;
+            if (!(lstPrograms.ListViewItemSorter is ListViewSorter))
+                return;
+            Sorter = (ListViewSorter)lstPrograms.ListViewItemSorter;
+
+            //if (Sorter.LastSort == e.Column)
+            //{
+            //    if (lstPrograms.Sorting == SortOrder.Ascending)
+            //        lstPrograms.Sorting = SortOrder.Descending;
+            //    else
+            //        lstPrograms.Sorting = SortOrder.Ascending;
+            //}
+            //else
+            //{
+            //    lstPrograms.Sorting = SortOrder.Descending;
+            //}
+            if (lstPrograms.Sorting == SortOrder.Ascending)
+                lstPrograms.Sorting = SortOrder.Descending;
+            else
+                lstPrograms.Sorting = SortOrder.Ascending;
+            Sorter.ByColumn = e.Column;
+
+            lstPrograms.Sort();
+        }
     }
 }
 

 

  ViewVC Help
Powered by ViewVC 1.1.22