+ windowTimer.Dispose();\r
+ errorService.ShowError("GetLog() Error", exc.ToString());\r
+ }\r
+\r
+ return appendText;\r
+ }\r
+\r
+ /// <summary>\r
+ /// Reads the log data from a Scan or Encode object\r
+ /// </summary>\r
+ /// <param name="reader">\r
+ /// The reader.\r
+ /// </param>\r
+ /// <param name="appendText">\r
+ /// The append text.\r
+ /// </param>\r
+ private void LogReader(StringReader reader, StringBuilder appendText)\r
+ {\r
+ string line;\r
+ int i = 1;\r
+ while ((line = reader.ReadLine()) != null)\r
+ {\r
+ if (i > position)\r
+ {\r
+ appendText.AppendLine(line);\r
+ position++;\r
+ }\r
+ i++;\r
+ }\r
+ }\r
+\r
+ /// <summary>\r
+ /// Append text to the RTF box\r
+ /// </summary>\r
+ /// <param name="text">\r
+ /// The text.\r
+ /// </param>\r
+ private void AppendWindowText(StringBuilder text)\r
+ {\r
+ try\r
+ {\r
+ if (IsHandleCreated)\r
+ {\r
+ if (rtf_actLog.InvokeRequired)\r
+ {\r
+ IAsyncResult invoked = BeginInvoke(new SetTextCallback(AppendWindowText), new object[] { text });\r
+ EndInvoke(invoked);\r
+ }\r
+ else\r
+ lock (rtf_actLog)\r
+ rtf_actLog.AppendText(text.ToString());\r
+\r
+ // Stop the refresh process if log has finished.\r
+ if (text.ToString().Contains("HandBrake has Exited"))\r
+ {\r
+ windowTimer.Dispose();\r
+ }\r
+ }\r
+ }\r
+ catch (Exception)\r
+ {\r
+ return;\r
+ }\r
+ }\r
+\r
+ /// <summary>\r
+ /// Clear the contents of the log window\r
+ /// </summary>\r
+ private void ClearWindowText()\r
+ {\r
+ try\r
+ {\r
+ if (IsHandleCreated)\r
+ {\r
+ if (rtf_actLog.InvokeRequired)\r
+ {\r
+ IAsyncResult invoked = BeginInvoke(new SetTextClearCallback(ClearWindowText));\r
+ EndInvoke(invoked);\r
+ }\r
+ else\r
+ lock (rtf_actLog)\r
+ rtf_actLog.Clear();\r
+ }\r
+ }\r
+ catch (Exception)\r
+ {\r
+ return;\r