- // System Information\r
- Functions.SystemInfo info = new Functions.SystemInfo();\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", info.getCpuCount()));\r
- rtf_actLog.AppendText(String.Format("### Ram: {0} MB \n", info.TotalPhysicalMemory()));\r
- rtf_actLog.AppendText(String.Format("### Screen: {0}x{1} \n", info.screenBounds().Bounds.Width, info.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
+ if (IsHandleCreated)\r
+ {\r
+ if (rtf_actLog.InvokeRequired)\r
+ {\r
+ IAsyncResult invoked = BeginInvoke(new SetModeCallback(SetMode), new object[] { setMode });\r
+ EndInvoke(invoked);\r
+ }\r
+ else\r
+ {\r
+ Reset();\r
+ this.mode = setMode;\r
+\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