/[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/13 14:39:08	130
+++ trunk/xmltv_parser/main.cs	2013/03/13 15:16:59	131
@@ -248,38 +248,57 @@
 
 
         #region Column Sorting Support
+        private bool Descending = false;
+        private void ToggleDescedning() { Descending = Descending ? false : true; }
         private void btnResetSort_Click(object sender, EventArgs e)
         {
             Type data_type;
             object datasource = XMLTV.CreateBindingSourceFromData(XMLTV.GetPrograms(), out data_type);
             dataGrid.DataSource = datasource;
+            ToggleDescedning();
         }
         private void btnSortChannelName_Click(object sender, EventArgs e)
         {
             object data = dataGrid.DataSource;
+            XMLTV.CreateSorterFromDataSource(ref data, Descending, "channelname");
+            dataGrid.DataSource = data;
+            ToggleDescedning();
         }
 
         private void btnSortStart_Click(object sender, EventArgs e)
         {
             object data = dataGrid.DataSource;
+            XMLTV.CreateSorterFromDataSource(ref data, Descending, "start");
+            dataGrid.DataSource = data;
+            ToggleDescedning();
         }
         private void btnSortStop_Click(object sender, EventArgs e)
         {
             object data = dataGrid.DataSource;
+            XMLTV.CreateSorterFromDataSource(ref data, Descending, "stop");
+            dataGrid.DataSource = data;
+            ToggleDescedning();
         }
         private void btnSortTitle_Click(object sender, EventArgs e)
         {
             object data = dataGrid.DataSource;
+            XMLTV.CreateSorterFromDataSource(ref data, Descending, "title");
+            dataGrid.DataSource = data;
+            ToggleDescedning();
         }
         private void btnSortSubTitle_Click(object sender, EventArgs e)
         {
             object data = dataGrid.DataSource;
-            XMLTV.CreateSorterFromDataSource(ref data, "subtitle");
+            XMLTV.CreateSorterFromDataSource(ref data, Descending, "subtitle");
             dataGrid.DataSource = data;
+            ToggleDescedning();
         }
         private void btnSortDescription_Click(object sender, EventArgs e)
         {
             object data = dataGrid.DataSource;
+            XMLTV.CreateSorterFromDataSource(ref data, Descending, "description");
+            dataGrid.DataSource = data;
+            ToggleDescedning();
         }
         #endregion
 

 

  ViewVC Help
Powered by ViewVC 1.1.22