/[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/08 04:01:25	46
+++ trunk/xmltv_parser/main.cs	2013/03/08 04:20:09	47
@@ -61,12 +61,30 @@
             }
             
         }
+        //bool txtLog_EnterMouse = false;
 
+        private void txtLog_MouseLeave(object sender, EventArgs e)
+        {
+            //txtLog_EnterMouse = false;
+        }
+        private void txtLog_MouseEnter(object sender, EventArgs e)
+        {
+            //txtLog_EnterMouse = true;
+        }
         void OnLogFlush(string logmessage)
         {
+            if (this.IsDisposed) { return; }
             Console.Write(logmessage);        
             txtStatus.Text = logmessage.Replace(System.Environment.NewLine, "");
-            Thread.Sleep(100);
+            txtLog.AppendText(logmessage);
+
+            //if (!txtLog_EnterMouse)
+            //{
+            txtLog.SelectionStart = txtLog.Text.Length; //Set the current caret position to the end
+            txtLog.ScrollToCaret(); //Now scroll it automatically
+            //}
+            //Thread.Sleep(100);
+            Application.DoEvents();
         }
 
         //List<IXMLTVChannel> Channels;
@@ -126,6 +144,7 @@
 
         private void mnuItemOpenXMLTVFile_Click(object sender, EventArgs e)
         {
+            ClearLocalLog();
             //LoadXMLTVShcedule("20130307_continuum_schedule.xml");
             var result = xmltv_file_chooser.ShowDialog();
             if (result != DialogResult.OK) return;
@@ -178,6 +197,21 @@
         {
             form_closing = true;
         }
+
+        private void mnuItemClearLocalLog_Click(object sender, EventArgs e)
+        {
+            ClearLocalLog();
+        }
+        private void ClearLocalLog()
+        {
+            var log_top_entry = txtLog.Lines.FirstOrDefault();
+            txtLog.Clear();
+            if (!string.IsNullOrEmpty(log_top_entry))
+            {
+                txtLog.AppendText(log_top_entry);
+            }
+        }
+
     }
 }
 

 

  ViewVC Help
Powered by ViewVC 1.1.22