/* frmActivityWindow.cs $\r
- \r
- This file is part of the HandBrake source code.\r
- Homepage: <http://handbrake.fr>.\r
- It may be used under the terms of the GNU General Public License. */\r
-\r
-using System;\r
-using System.Collections;\r
-using System.Collections.Generic;\r
-using System.ComponentModel;\r
-using System.Data;\r
-using System.Drawing;\r
-using System.Text;\r
-using System.Windows.Forms;\r
-using System.IO;\r
-using System.Threading;\r
-using System.Diagnostics;\r
-using System.Runtime.InteropServices;\r
-using Microsoft.Win32;\r
-\r
+ This file is part of the HandBrake source code.\r
+ Homepage: <http://handbrake.fr>.\r
+ It may be used under the terms of the GNU General Public License. */\r
\r
namespace Handbrake\r
{\r
+ using System;\r
+ using System.ComponentModel;\r
+ using System.Diagnostics;\r
+ using System.IO;\r
+ using System.Text;\r
+ using System.Threading;\r
+ using System.Windows.Forms;\r
+\r
+ using HandBrake.ApplicationServices.Services.Interfaces;\r
+\r
+ using Model;\r
+ using Timer = System.Threading.Timer;\r
+\r
+ /// <summary>\r
+ /// The Activity Log Window\r
+ /// </summary>\r
public partial class frmActivityWindow : Form\r
{\r
- delegate void SetTextCallback(string text);\r
- String read_file;\r
- Thread monitor;\r
- frmMain mainWindow;\r
- frmQueue queueWindow;\r
- int position = 0; // Position in the arraylist reached by the current log output in the rtf box.\r
+ /* Private Variables */\r
\r
/// <summary>\r
- /// This window should be used to display the RAW output of the handbrake CLI which is produced during an encode.\r
+ /// The current position in the log file\r
/// </summary>\r
- public frmActivityWindow(string file, frmMain fm, frmQueue fq)\r
- {\r
- InitializeComponent();\r
- this.rtf_actLog.Text = string.Empty;\r
+ private int position;\r
\r
- // When the window closes, we want to abort the monitor thread.\r
- this.Disposed += new EventHandler(forceQuit);\r
+ /// <summary>\r
+ /// A Timer for this window\r
+ /// </summary>\r
+ private Timer windowTimer;\r
\r
- mainWindow = fm;\r
- queueWindow = fq;\r
- read_file = file;\r
- position = 0;\r
+ /// <summary>\r
+ /// The Encode Object\r
+ /// </summary>\r
+ private IQueue encode;\r
\r
- // Print the Log header in the Rich text box.\r
- displayLogHeader();\r
+ /// <summary>\r
+ /// The Scan Object\r
+ /// </summary>\r
+ private IScan scan;\r
\r
- if (file == "dvdinfo.dat")\r
- txt_log.Text = "Scan Log";\r
- else if (file == "hb_encode_log.dat")\r
- txt_log.Text = "Encode Log";\r
+ /// <summary>\r
+ /// The Type of log that the window is currently dealing with\r
+ /// </summary>\r
+ private ActivityLogMode mode;\r
\r
- // Start a new thread which will montior and keep the log window up to date if required/\r
- startLogThread(read_file); \r
- }\r
+ /* Constructor */\r
\r
/// <summary>\r
- /// Displays the Log header\r
+ /// Initializes a new instance of the <see cref="frmActivityWindow"/> class.\r
/// </summary>\r
- private void displayLogHeader()\r
+ /// <param name="encode">\r
+ /// The encode.\r
+ /// </param>\r
+ /// <param name="scan">\r
+ /// The scan.\r
+ /// </param>\r
+ public frmActivityWindow(IQueue encode, IScan scan)\r
{\r
- // Add a header to the log file indicating that it's from the Windows GUI and display the windows version\r
- rtf_actLog.AppendText(String.Format("### Windows GUI {1} {0} \n", Properties.Settings.Default.hb_build, Properties.Settings.Default.hb_version));\r
- rtf_actLog.AppendText(String.Format("### Running: {0} \n###\n", Environment.OSVersion.ToString()));\r
- rtf_actLog.AppendText(String.Format("### CPU: {0} \n", getCpuCount()));\r
- rtf_actLog.AppendText(String.Format("### Ram: {0} MB \n", TotalPhysicalMemory()));\r
- rtf_actLog.AppendText(String.Format("### Screen: {0}x{1} \n", screenBounds().Bounds.Width, screenBounds().Bounds.Height));\r
- rtf_actLog.AppendText(String.Format("### Temp Dir: {0} \n", Path.GetTempPath()));\r
- rtf_actLog.AppendText(String.Format("### Install Dir: {0} \n", Application.StartupPath));\r
- rtf_actLog.AppendText(String.Format("### Data Dir: {0} \n", Application.UserAppDataPath));\r
- rtf_actLog.AppendText("#########################################\n\n");\r
+ InitializeComponent();\r
+\r
+ this.encode = encode;\r
+ this.scan = scan;\r
+ this.position = 0;\r
+\r
+ // Listen for Scan and Encode Starting Events\r
+ scan.ScanStared += scan_ScanStared;\r
+ encode.EncodeStarted += encode_EncodeStarted;\r
}\r
\r
+ /* Delegates */\r
+\r
+ /// <summary>\r
+ /// A callback function for updating the ui\r
+ /// </summary>\r
+ /// <param name="text">\r
+ /// The text.\r
+ /// </param>\r
+ private delegate void SetTextCallback(StringBuilder text);\r
+\r
+ /// <summary>\r
+ /// Clear text callback\r
+ /// </summary>\r
+ private delegate void SetTextClearCallback();\r
+\r
/// <summary>\r
- /// Starts a new thread which runs the autoUpdate function.\r
+ /// Set mode callback\r
/// </summary>\r
- /// <param name="file"> File which will be used to populate the Rich text box.</param>\r
- private void startLogThread(string file)\r
+ /// <param name="setMode">\r
+ /// The set mode.\r
+ /// </param>\r
+ private delegate void SetModeCallback(ActivityLogMode setMode);\r
+\r
+ /* Private Methods */\r
+\r
+ /// <summary>\r
+ /// Set the window to scan mode\r
+ /// </summary>\r
+ /// <param name="setMode">\r
+ /// The set Mode.\r
+ /// </param>\r
+ private void SetMode(ActivityLogMode setMode)\r
{\r
- try\r
+ if (IsHandleCreated)\r
{\r
- string logFile = Path.Combine(Path.GetTempPath(), file);\r
- if (File.Exists(logFile))\r
+ if (rtf_actLog.InvokeRequired)\r
{\r
- // Start a new thread to run the autoUpdate process\r
- monitor = new Thread(autoUpdate);\r
- monitor.IsBackground = true;\r
- monitor.Start();\r
+ IAsyncResult invoked = BeginInvoke(new SetModeCallback(SetMode), new object[] {setMode});\r
+ EndInvoke(invoked);\r
}\r
else\r
- rtf_actLog.AppendText("\n\n\nERROR: The log file could not be found. \nMaybe you cleared your system's tempory folder or maybe you just havn't run an encode yet. \nTried to find the log file in: " + logFile);\r
+ {\r
+ Reset();\r
+ this.mode = setMode;\r
\r
- }\r
- catch (Exception exc)\r
- {\r
- MessageBox.Show("startLogThread(): Exception: \n" + exc);\r
+ Array values = Enum.GetValues(typeof(ActivityLogMode));\r
+ Properties.Settings.Default.ActivityWindowLastMode = (int) values.GetValue(Convert.ToInt32(setMode));\r
+ Properties.Settings.Default.Save();\r
+\r
+ this.Text = mode == ActivityLogMode.Scan\r
+ ? "Activity Window (Scan Log)"\r
+ : "Activity Window (Encode Log)";\r
+\r
+ if (mode == ActivityLogMode.Scan)\r
+ {\r
+ scan.ScanCompleted += stopWindowRefresh;\r
+ encode.EncodeEnded -= stopWindowRefresh;\r
+ }\r
+ else\r
+ {\r
+ scan.ScanCompleted -= stopWindowRefresh;\r
+ encode.EncodeEnded += stopWindowRefresh;\r
+ }\r
+\r
+ // Start a fresh window timer\r
+ windowTimer = new Timer(new TimerCallback(LogMonitor), null, 1000, 1000);\r
+ }\r
}\r
}\r
\r
/// <summary>\r
- /// Change the log file to be displayed to hb_encode_log.dat\r
+ /// On Window load, start a new timer\r
/// </summary>\r
- /// <param name="sender"></param>\r
- /// <param name="e"></param>\r
- private void btn_scan_log_Click(object sender, EventArgs e)\r
+ /// <param name="sender">\r
+ /// The sender.\r
+ /// </param>\r
+ /// <param name="e">\r
+ /// The e.\r
+ /// </param>\r
+ private void NewActivityWindow_Load(object sender, EventArgs e)\r
{\r
- if (monitor != null)\r
- monitor.Abort();\r
-\r
- rtf_actLog.Clear();\r
- read_file = "dvdinfo.dat";\r
- displayLogHeader();\r
- startLogThread(read_file);\r
- txt_log.Text = "Scan Log";\r
+ ActivityLogMode activitLogMode = (ActivityLogMode) Enum.ToObject(typeof(ActivityLogMode), Properties.Settings.Default.ActivityWindowLastMode);\r
+ SetMode(activitLogMode); \r
}\r
\r
/// <summary>\r
- /// Change the log file to be displayed to dvdinfo.dat\r
+ /// Set the Log window to encode mode when an encode starts.\r
/// </summary>\r
- /// <param name="sender"></param>\r
- /// <param name="e"></param>\r
- private void btn_encode_log_Click(object sender, EventArgs e)\r
+ /// <param name="sender">\r
+ /// The sender.\r
+ /// </param>\r
+ /// <param name="e">\r
+ /// The e.\r
+ /// </param>\r
+ private void encode_EncodeStarted(object sender, EventArgs e)\r
{\r
- if (monitor != null)\r
- monitor.Abort();\r
+ SetMode(ActivityLogMode.Encode);\r
+ }\r
\r
- rtf_actLog.Clear();\r
- read_file = "hb_encode_log.dat";\r
- position = 0;\r
- displayLogHeader();\r
- startLogThread(read_file);\r
- txt_log.Text = "Encode Log";\r
+ /// <summary>\r
+ /// Set the log widow to scan mode when a scan starts\r
+ /// </summary>\r
+ /// <param name="sender">\r
+ /// The sender.\r
+ /// </param>\r
+ /// <param name="e">\r
+ /// The e.\r
+ /// </param>\r
+ private void scan_ScanStared(object sender, EventArgs e)\r
+ {\r
+ SetMode(ActivityLogMode.Scan);\r
}\r
\r
/// <summary>\r
- /// Copy to Clipboard\r
+ /// Stop refreshing the window when no scanning or encoding is happening.\r
/// </summary>\r
- /// <param name="sender"></param>\r
- /// <param name="e"></param>\r
- private void btn_copy_Click(object sender, EventArgs e)\r
+ /// <param name="sender">\r
+ /// The sender.\r
+ /// </param>\r
+ /// <param name="e">\r
+ /// The e.\r
+ /// </param>\r
+ private void stopWindowRefresh(object sender, EventArgs e)\r
{\r
- if (rtf_actLog.SelectedText != "")\r
- Clipboard.SetDataObject(rtf_actLog.SelectedText, true);\r
- else\r
- Clipboard.SetDataObject(rtf_actLog.Text, true);\r
+ windowTimer.Dispose();\r
+ LogMonitor(null);\r
}\r
\r
/// <summary>\r
- /// Updates the log window with any new data which is in the log file.\r
- /// This is done every 5 seconds.\r
+ /// Append new text to the window\r
/// </summary>\r
- /// <param name="state"></param>\r
- private void autoUpdate(object state)\r
+ /// <param name="n">\r
+ /// The n.\r
+ /// </param>\r
+ private void LogMonitor(object n)\r
{\r
- try\r
+ AppendWindowText(GetLog());\r
+ }\r
+\r
+ /// <summary>\r
+ /// New Code for getting the Activity log from the Services rather than reading a file.\r
+ /// </summary>\r
+ /// <returns>\r
+ /// The StringBuilder containing a log\r
+ /// </returns>\r
+ private StringBuilder GetLog()\r
+ {\r
+ StringBuilder appendText = new StringBuilder();\r
+\r
+ if (this.mode == ActivityLogMode.Scan)\r
{\r
- Boolean lastUpdate = false;\r
- updateTextFromThread();\r
- while (true)\r
+ if (scan == null || scan.ActivityLog == string.Empty)\r
{\r
- if ((mainWindow.isEncoding() == true) || (queueWindow.isEncoding() == true))\r
- updateTextFromThread();\r
- else\r
- {\r
- // The encode may just have stoped, so, refresh the log one more time before restarting it.\r
- if (lastUpdate == false)\r
- updateTextFromThread();\r
+ appendText.AppendFormat("Waiting for the log to be generated ...\n");\r
+ position = 0;\r
+ ClearWindowText();\r
+ return appendText;\r
+ }\r
\r
- lastUpdate = true; // Prevents the log window from being updated when there is no encode going.\r
- position = 0; // There is no encoding, so reset the log position counter to 0 so it can be reused\r
- }\r
- Thread.Sleep(5000);\r
+ using (StringReader reader = new StringReader(scan.ActivityLog))\r
+ {\r
+ LogReader(reader, appendText);\r
}\r
}\r
- catch (ThreadAbortException)\r
- {\r
- // Do Nothing. This is needed since we run thread.abort(). \r
- // Should probably find a better way of making this work at some point.\r
- }\r
- catch (Exception exc)\r
+ else\r
{\r
- MessageBox.Show("autoUpdate(): Exception: \n" + exc);\r
+ if (encode == null || encode.ActivityLog == string.Empty)\r
+ {\r
+ appendText.AppendFormat("Waiting for the log to be generated ...\n");\r
+ position = 0;\r
+ ClearWindowText();\r
+ return appendText;\r
+ }\r
+\r
+ using (StringReader reader = new StringReader(encode.ActivityLog))\r
+ {\r
+ LogReader(reader, appendText);\r
+ }\r
}\r
+ return appendText;\r
}\r
\r
/// <summary>\r
- /// Finds any new text in the log file and calls a funciton to display this new text.\r
+ /// Reads the log data from a Scan or Encode object\r
/// </summary>\r
- private void updateTextFromThread()\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
- try\r
+ string line;\r
+ int i = 1;\r
+ while ((line = reader.ReadLine()) != null)\r
{\r
- string text = "";\r
- List<string> data = readFile();\r
- int count = data.Count;\r
-\r
- while (position < count)\r
+ if (i > position)\r
{\r
- text = data[position].ToString();\r
- if (data[position].ToString().Contains("has exited"))\r
- text = "\n ############ End of Log ############## \n";\r
+ appendText.AppendLine(line);\r
position++;\r
-\r
- SetText(text);\r
}\r
- }\r
- catch (Exception exc)\r
- {\r
- MessageBox.Show("updateTextFromThread(): Exception: \n" + exc);\r
+ i++;\r
}\r
}\r
\r
/// <summary>\r
- /// Updates the rich text box with anything in the string text.\r
+ /// Append text to the RTF box\r
/// </summary>\r
- /// <param name="text"></param>\r
- private void SetText(string text)\r
+ /// <param name="text">\r
+ /// The text.\r
+ /// </param>\r
+ private void AppendWindowText(StringBuilder text)\r
{\r
try\r
{\r
- // InvokeRequired required compares the thread ID of the\r
- // calling thread to the thread ID of the creating thread.\r
- // If these threads are different, it returns true.\r
- if (this.IsHandleCreated) // Make sure the windows has a handle before doing anything\r
+ if (IsHandleCreated)\r
{\r
- if (this.rtf_actLog.InvokeRequired)\r
+ if (rtf_actLog.InvokeRequired)\r
{\r
- SetTextCallback d = new SetTextCallback(SetText);\r
- this.Invoke(d, new object[] { text });\r
+ IAsyncResult invoked = BeginInvoke(new SetTextCallback(AppendWindowText), new object[] { text });\r
+ EndInvoke(invoked);\r
}\r
else\r
- this.rtf_actLog.AppendText(text);\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 exc)\r
+ catch (Exception)\r
{\r
- MessageBox.Show("SetText(): Exception: \n" + exc);\r
+ return;\r
}\r
}\r
\r
/// <summary>\r
- /// Read the log file, and store the data in a List.\r
+ /// Clear the contents of the log window\r
/// </summary>\r
- /// <returns></returns>\r
- private List<string> readFile()\r
+ private void ClearWindowText()\r
{\r
- // Ok, the task here is to, Get an arraylist of log data.\r
- // And update some global varibles which are pointers to the last displayed log line.\r
- List<string> logData = new List<string>();\r
-\r
try\r
{\r
- // hb_encode_log.dat is the primary log file. Since .NET can't read this file whilst the CLI is outputing to it (Not even in read only mode),\r
- // we'll need to make a copy of it.\r
- string logFile = Path.Combine(Path.GetTempPath(), read_file);\r
- string logFile2 = Path.Combine(Path.GetTempPath(), "hb_encode_log_AppReadable.dat");\r
-\r
- // Make sure the application readable log file does not already exist. FileCopy fill fail if it does.\r
- if (File.Exists(logFile2))\r
- File.Delete(logFile2);\r
-\r
- // Copy the log file.\r
- File.Copy(logFile, logFile2);\r
-\r
- // Open the copied log file for reading\r
- StreamReader sr = new StreamReader(logFile2);\r
- string line = sr.ReadLine();\r
- while (line != null)\r
+ if (IsHandleCreated)\r
{\r
- if (line.Trim() != "")\r
- logData.Add(line + System.Environment.NewLine);\r
-\r
- line = sr.ReadLine();\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
- sr.Close();\r
- sr.Dispose();\r
-\r
- return logData;\r
}\r
- catch (Exception exc)\r
+ catch (Exception)\r
{\r
- MessageBox.Show("Error in readFile() \n Unable to read the log file.\n You may have to restart HandBrake.\n Error Information: \n\n" + exc.ToString(), "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning);\r
+ return;\r
}\r
- return null;\r
}\r
\r
/// <summary>\r
- /// Kills the montior thead when the window is disposed of.\r
+ /// Reset Everything\r
/// </summary>\r
- /// <param name="sender"></param>\r
- /// <param name="e"></param>\r
- private void forceQuit(object sender, EventArgs e)\r
+ private void Reset()\r
{\r
- if (monitor != null)\r
- {\r
- while (monitor.IsAlive)\r
- monitor.Abort();\r
- }\r
-\r
- this.Close();\r
+ if (windowTimer != null)\r
+ windowTimer.Dispose();\r
+ position = 0;\r
+ ClearWindowText();\r
+ windowTimer = new Timer(new TimerCallback(LogMonitor), null, 1000, 1000);\r
}\r
\r
+ /* Menus and Buttons */\r
+\r
/// <summary>\r
- /// Copy Log Menu Item on the right click menu for the log rtf box\r
+ /// Copy log to clipboard\r
/// </summary>\r
- /// <param name="sender"></param>\r
- /// <param name="e"></param>\r
- private void mnu_copy_log_Click(object sender, EventArgs e)\r
+ /// <param name="sender">\r
+ /// The sender.\r
+ /// </param>\r
+ /// <param name="e">\r
+ /// The e.\r
+ /// </param>\r
+ private void MnuCopyLogClick(object sender, EventArgs e)\r
{\r
- if (rtf_actLog.SelectedText != "")\r
- Clipboard.SetDataObject(rtf_actLog.SelectedText, true);\r
- else\r
- Clipboard.SetDataObject(rtf_actLog.Text, true);\r
+ Clipboard.SetDataObject(rtf_actLog.SelectedText != string.Empty ? rtf_actLog.SelectedText : rtf_actLog.Text, true);\r
}\r
\r
- #region System Information\r
- private struct MEMORYSTATUS\r
+ /// <summary>\r
+ /// Open the log folder\r
+ /// </summary>\r
+ /// <param name="sender">\r
+ /// The sender.\r
+ /// </param>\r
+ /// <param name="e">\r
+ /// The e.\r
+ /// </param>\r
+ private void MnuOpenLogFolderClick(object sender, EventArgs e)\r
{\r
- public UInt32 dwLength;\r
- public UInt32 dwMemoryLoad;\r
- public UInt32 dwTotalPhys; // Used\r
- public UInt32 dwAvailPhys;\r
- public UInt32 dwTotalPageFile;\r
- public UInt32 dwAvailPageFile;\r
- public UInt32 dwTotalVirtual;\r
- public UInt32 dwAvailVirtual;\r
+ string logDir = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "\\HandBrake\\logs";\r
+ string windir = Environment.GetEnvironmentVariable("WINDIR");\r
+ Process prc = new Process\r
+ {\r
+ StartInfo =\r
+ {\r
+ FileName = windir + @"\explorer.exe",\r
+ Arguments = logDir\r
+ }\r
+ };\r
+ prc.Start();\r
}\r
\r
- [DllImport("kernel32.dll")]\r
- private static extern void GlobalMemoryStatus\r
- (\r
- ref MEMORYSTATUS lpBuffer\r
- );\r
-\r
/// <summary>\r
- /// Returns the total physical ram in a system\r
+ /// Copy the log\r
/// </summary>\r
- /// <returns></returns>\r
- public uint TotalPhysicalMemory()\r
+ /// <param name="sender">\r
+ /// The sender.\r
+ /// </param>\r
+ /// <param name="e">\r
+ /// The e.\r
+ /// </param>\r
+ private void BtnCopyClick(object sender, EventArgs e)\r
{\r
- MEMORYSTATUS memStatus = new MEMORYSTATUS();\r
- GlobalMemoryStatus(ref memStatus);\r
-\r
- uint MemoryInfo = memStatus.dwTotalPhys;\r
- MemoryInfo = MemoryInfo / 1024 / 1024;\r
-\r
- return MemoryInfo;\r
+ Clipboard.SetDataObject(rtf_actLog.SelectedText != string.Empty ? rtf_actLog.SelectedText : rtf_actLog.Text, true);\r
}\r
\r
/// <summary>\r
- /// Get the number of CPU Cores\r
+ /// Set scan mode\r
/// </summary>\r
- /// <returns>Object</returns>\r
- public Object getCpuCount()\r
+ /// <param name="sender">\r
+ /// The sender.\r
+ /// </param>\r
+ /// <param name="e">\r
+ /// The e.\r
+ /// </param>\r
+ private void BtnScanLogClick(object sender, EventArgs e)\r
{\r
- RegistryKey RegKey = Registry.LocalMachine;\r
- RegKey = RegKey.OpenSubKey("HARDWARE\\DESCRIPTION\\System\\CentralProcessor\\0");\r
- return RegKey.GetValue("ProcessorNameString");\r
+ SetMode(ActivityLogMode.Scan);\r
}\r
\r
/// <summary>\r
- /// Get the System screen size information.\r
+ /// Set the encode mode\r
/// </summary>\r
- /// <returns>System.Windows.Forms.Scree</returns>\r
- public System.Windows.Forms.Screen screenBounds()\r
+ /// <param name="sender">\r
+ /// The sender.\r
+ /// </param>\r
+ /// <param name="e">\r
+ /// The e.\r
+ /// </param>\r
+ private void BtnEncodeLogClick(object sender, EventArgs e)\r
{\r
- return System.Windows.Forms.Screen.PrimaryScreen;\r
+ SetMode(ActivityLogMode.Encode);\r
}\r
\r
- #endregion\r
+ /* Overrides */\r
\r
+ /// <summary>\r
+ /// override onclosing\r
+ /// </summary>\r
+ /// <param name="e">\r
+ /// The e.\r
+ /// </param>\r
+ protected override void OnClosing(CancelEventArgs e)\r
+ {\r
+ scan.ScanStared -= scan_ScanStared;\r
+ encode.EncodeStarted -= encode_EncodeStarted;\r
+\r
+ scan.ScanCompleted -= stopWindowRefresh;\r
+ encode.EncodeEnded -= stopWindowRefresh;\r
+\r
+ windowTimer.Dispose();\r
+ e.Cancel = true;\r
+ this.Dispose();\r
+ base.OnClosing(e);\r
+ }\r
}\r
}
\ No newline at end of file