/[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 129 by william, Wed Mar 13 14:03:47 2013 UTC revision 131 by william, Wed Mar 13 15:16:59 2013 UTC
# Line 195  namespace xmltv_parser Line 195  namespace xmltv_parser
195                  CreatControlsFromType(data_type);                  CreatControlsFromType(data_type);
196                  //XMLTV.CreateSorterFromDataSource(ref datasource, "title");                  //XMLTV.CreateSorterFromDataSource(ref datasource, "title");
197                  dataGrid.DataSource = datasource;                  dataGrid.DataSource = datasource;
198                    flow_datagrid_sort.Enabled = true;
199              }              }
200              catch (Exception ex) { gLog.Error.WriteLine(ex.ToString()); }              catch (Exception ex) { gLog.Error.WriteLine(ex.ToString()); }
201          }          }
# Line 243  namespace xmltv_parser Line 244  namespace xmltv_parser
244          {          {
245              gLog.Warn.WriteLine("No controls have been defined for: {0}", data_type.Name);              gLog.Warn.WriteLine("No controls have been defined for: {0}", data_type.Name);
246          }          }
247            #endregion    
248    
249    
250            #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)
254            {
255                Type data_type;
256                object datasource = XMLTV.CreateBindingSourceFromData(XMLTV.GetPrograms(), out data_type);
257                dataGrid.DataSource = datasource;
258                ToggleDescedning();
259            }
260            private void btnSortChannelName_Click(object sender, EventArgs e)
261            {
262                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)
269            {
270                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)
276            {
277                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)
283            {
284                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)
290            {
291                object data = dataGrid.DataSource;
292                XMLTV.CreateSorterFromDataSource(ref data, Descending, "subtitle");
293                dataGrid.DataSource = data;
294                ToggleDescedning();
295            }
296            private void btnSortDescription_Click(object sender, EventArgs e)
297            {
298                object data = dataGrid.DataSource;
299                XMLTV.CreateSorterFromDataSource(ref data, Descending, "description");
300                dataGrid.DataSource = data;
301                ToggleDescedning();
302            }
303          #endregion          #endregion
304    
305          
306      }      }
307  }  }
308    

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

  ViewVC Help
Powered by ViewVC 1.1.22