/[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 60 by william, Fri Mar 8 13:57:42 2013 UTC revision 62 by william, Fri Mar 8 14:24:17 2013 UTC
# Line 28  namespace xmltv_parser Line 28  namespace xmltv_parser
28          public main()          public main()
29          {          {
30              InitializeComponent();              InitializeComponent();
31                ListViewSorter Sorter = new ListViewSorter();
32                lstPrograms.ListViewItemSorter = Sorter;
33    
34              string log_path = Application.StartupPath;              string log_path = Application.StartupPath;
35              string log_filename = string.Format("{0}.log", typeof(main).Assembly.GetName().Name);              string log_filename = string.Format("{0}.log", typeof(main).Assembly.GetName().Name);
36              gLog.CreateLog(string.Format(@"{0}\{1}", log_path, log_filename), false, LogLevel.kLogLevel_All_NoProgress, new EventHandler<LoggerOnFlushEventArgs>(Log_OnFlush));              gLog.CreateLog(string.Format(@"{0}\{1}", log_path, log_filename), false, LogLevel.kLogLevel_All_NoProgress, new EventHandler<LoggerOnFlushEventArgs>(Log_OnFlush));
# Line 51  namespace xmltv_parser Line 54  namespace xmltv_parser
54          private void gLog_ReportProgress(object sender, ReportProgressEventArgs e) { ReportProgress(e.Progress); }          private void gLog_ReportProgress(object sender, ReportProgressEventArgs e) { ReportProgress(e.Progress); }
55    
56          StringBuilder log_flusher = new StringBuilder();          StringBuilder log_flusher = new StringBuilder();
57            
58          void Log_OnFlush(object sender, LoggerOnFlushEventArgs e)          void Log_OnFlush(object sender, LoggerOnFlushEventArgs e)
59          {          {
60              OnLogFlush(e.Buffer);              OnLogFlush(e.Buffer);
# Line 75  namespace xmltv_parser Line 78  namespace xmltv_parser
78          }          }
79    
80          void UpdateStatus(string logmessage)          void UpdateStatus(string logmessage)
81          {                      {
82              txtStatus.Text = logmessage.Replace(System.Environment.NewLine, "");              txtStatus.Text = logmessage.Replace(System.Environment.NewLine, "");
83          }          }
84          void UpdateLogOutput(string logmessage)          void UpdateLogOutput(string logmessage)
# Line 111  namespace xmltv_parser Line 114  namespace xmltv_parser
114          {          {
115              //XMLTV.CreateInstance(schedule_xml, new EventHandler<CancelEventArgs>(xmltv_cancelevent));              //XMLTV.CreateInstance(schedule_xml, new EventHandler<CancelEventArgs>(xmltv_cancelevent));
116              XMLTV.CreateInstance(schedule_xml);              XMLTV.CreateInstance(schedule_xml);
117              XMLTV.OnInstanceCreated += new EventHandler<EventArgs>(XMLTV_OnInstanceCreated);                        XMLTV.OnInstanceCreated += new EventHandler<EventArgs>(XMLTV_OnInstanceCreated);
118          }          }
119    
120          void XMLTV_OnInstanceCreated(object sender, EventArgs e)          void XMLTV_OnInstanceCreated(object sender, EventArgs e)
# Line 261  namespace xmltv_parser Line 264  namespace xmltv_parser
264              if (program == null) { return; }              if (program == null) { return; }
265              txtStatus.Text = program.ToString();              txtStatus.Text = program.ToString();
266              //gLog.Debug.WriteLine(program.ToString());              //gLog.Debug.WriteLine(program.ToString());
267                
268          }          }
269    
270            private void lstPrograms_ColumnClick(object sender, ColumnClickEventArgs e)
271            {
272                if (!(lstPrograms.ListViewItemSorter is ListViewSorter)) return;
273                ListViewSorter Sorter = (ListViewSorter)lstPrograms.ListViewItemSorter;
274                Sorter.LastColumn = Sorter.CurrentColumn;
275                Sorter.CurrentColumn = e.Column;
276                if (Sorter.LastColumn == e.Column)
277                {
278                    if (lstPrograms.Sorting == SortOrder.Ascending) { lstPrograms.Sorting = SortOrder.Descending; }
279                    else { lstPrograms.Sorting = SortOrder.Ascending; }
280                }
281                else { lstPrograms.Sorting = SortOrder.Descending; }
282                lstPrograms.Sort();
283            }
284      }      }
285  }  }
286    

Legend:
Removed from v.60  
changed lines
  Added in v.62

  ViewVC Help
Powered by ViewVC 1.1.22