/[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 58 by william, Fri Mar 8 12:05:33 2013 UTC revision 59 by william, Fri Mar 8 13:40:32 2013 UTC
# Line 30  namespace xmltv_parser Line 30  namespace xmltv_parser
30              InitializeComponent();              InitializeComponent();
31              string log_path = Application.StartupPath;              string log_path = Application.StartupPath;
32              string log_filename = string.Format("{0}.log", typeof(main).Assembly.GetName().Name);              string log_filename = string.Format("{0}.log", typeof(main).Assembly.GetName().Name);
33              gLog.CreateLog(string.Format(@"{0}\{1}", log_path, log_filename), false, LogLevel.kLogLevel_All, 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));
34                gLog.SetLogLevel(gLog.LogLevel & ~LogLevel.kLogLevel_VerboseDebug);
35                gLog.ReportProgressEvent += new EventHandler<ReportProgressEventArgs>(gLog_ReportProgress);
36          }          }
37    
38            private void ReportProgress(int progress)
39            {
40                if (this.InvokeRequired)
41                {
42                    try
43                    {
44                        this.Invoke((Action)(delegate { ReportProgress(progress); }));
45                    }
46                    catch { }
47                    return;
48                }
49                progress_status.Value = progress;
50            }
51            private void gLog_ReportProgress(object sender, ReportProgressEventArgs e) { ReportProgress(e.Progress); }
52    
53          StringBuilder log_flusher = new StringBuilder();          StringBuilder log_flusher = new StringBuilder();
54                    
55          void Log_OnFlush(object sender, LoggerOnFlushEventArgs e)          void Log_OnFlush(object sender, LoggerOnFlushEventArgs e)
# Line 99  namespace xmltv_parser Line 116  namespace xmltv_parser
116    
117          void XMLTV_OnInstanceCreated(object sender, EventArgs e)          void XMLTV_OnInstanceCreated(object sender, EventArgs e)
118          {          {
119                ReportProgress(0);
120              var instance = XMLTV.GetInstance();              var instance = XMLTV.GetInstance();
121              if (instance != null)              if (instance != null)
122              {              {
# Line 142  namespace xmltv_parser Line 160  namespace xmltv_parser
160          {          {
161              try              try
162              {              {
163                    lstPrograms.Items.Clear();
164                  //LoadXMLTVShcedule("20130307_continuum_schedule.xml");                  //LoadXMLTVShcedule("20130307_continuum_schedule.xml");
165                  var result = xmltv_file_chooser.ShowDialog();                  var result = xmltv_file_chooser.ShowDialog();
166                  if (result != DialogResult.OK) return;                  if (result != DialogResult.OK) return;

Legend:
Removed from v.58  
changed lines
  Added in v.59

  ViewVC Help
Powered by ViewVC 1.1.22