/[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

revision 130 by william, Wed Mar 13 14:39:08 2013 UTC revision 131 by william, Wed Mar 13 15:16:59 2013 UTC
# Line 248  namespace xmltv_parser Line 248  namespace xmltv_parser
248    
249    
250          #region Column Sorting Support          #region Column Sorting Support
251            private bool Descending = false;
252            private void ToggleDescedning() { Descending = Descending ? false : true; }
253          private void btnResetSort_Click(object sender, EventArgs e)          private void btnResetSort_Click(object sender, EventArgs e)
254          {          {
255              Type data_type;              Type data_type;
256              object datasource = XMLTV.CreateBindingSourceFromData(XMLTV.GetPrograms(), out data_type);              object datasource = XMLTV.CreateBindingSourceFromData(XMLTV.GetPrograms(), out data_type);
257              dataGrid.DataSource = datasource;              dataGrid.DataSource = datasource;
258                ToggleDescedning();
259          }          }
260          private void btnSortChannelName_Click(object sender, EventArgs e)          private void btnSortChannelName_Click(object sender, EventArgs e)
261          {          {
262              object data = dataGrid.DataSource;              object data = dataGrid.DataSource;
263                XMLTV.CreateSorterFromDataSource(ref data, Descending, "channelname");
264                dataGrid.DataSource = data;
265                ToggleDescedning();
266          }          }
267    
268          private void btnSortStart_Click(object sender, EventArgs e)          private void btnSortStart_Click(object sender, EventArgs e)
269          {          {
270              object data = dataGrid.DataSource;              object data = dataGrid.DataSource;
271                XMLTV.CreateSorterFromDataSource(ref data, Descending, "start");
272                dataGrid.DataSource = data;
273                ToggleDescedning();
274          }          }
275          private void btnSortStop_Click(object sender, EventArgs e)          private void btnSortStop_Click(object sender, EventArgs e)
276          {          {
277              object data = dataGrid.DataSource;              object data = dataGrid.DataSource;
278                XMLTV.CreateSorterFromDataSource(ref data, Descending, "stop");
279                dataGrid.DataSource = data;
280                ToggleDescedning();
281          }          }
282          private void btnSortTitle_Click(object sender, EventArgs e)          private void btnSortTitle_Click(object sender, EventArgs e)
283          {          {
284              object data = dataGrid.DataSource;              object data = dataGrid.DataSource;
285                XMLTV.CreateSorterFromDataSource(ref data, Descending, "title");
286                dataGrid.DataSource = data;
287                ToggleDescedning();
288          }          }
289          private void btnSortSubTitle_Click(object sender, EventArgs e)          private void btnSortSubTitle_Click(object sender, EventArgs e)
290          {          {
291              object data = dataGrid.DataSource;              object data = dataGrid.DataSource;
292              XMLTV.CreateSorterFromDataSource(ref data, "subtitle");              XMLTV.CreateSorterFromDataSource(ref data, Descending, "subtitle");
293              dataGrid.DataSource = data;              dataGrid.DataSource = data;
294                ToggleDescedning();
295          }          }
296          private void btnSortDescription_Click(object sender, EventArgs e)          private void btnSortDescription_Click(object sender, EventArgs e)
297          {          {
298              object data = dataGrid.DataSource;              object data = dataGrid.DataSource;
299                XMLTV.CreateSorterFromDataSource(ref data, Descending, "description");
300                dataGrid.DataSource = data;
301                ToggleDescedning();
302          }          }
303          #endregion          #endregion
304    

Legend:
Removed from v.130  
changed lines
  Added in v.131

  ViewVC Help
Powered by ViewVC 1.1.22