/// <summary> /// This method reports a message in the diagnostic window /// </summary> /// <param name="message"></param> public void ReportDiagnosticMessage(String message) { if (_DiagnosticWindow.InvokeRequired) { _DiagnosticWindow.Invoke(new Action <String>(ReportDiagnosticMessage), message); } else { _DiagnosticWindow.Report(message); OutputDebugString(message); } }
/// <summary> /// Shows the diagnostic form if needed /// </summary> /// <param name="isShown"><c>true</c> if we want to show the diagnostic window</param> public void ShowDiagnosticWindowIfNeeded(bool isShown) { if (!_isDiagnosticWindowShown || _diagnosticWindow == null) { return; } if (_diagnosticWindow.InvokeRequired) { _diagnosticWindow.Invoke(new Action(() => ShowDiagnosticWindowIfNeeded(isShown))); } else { // check the diagnotic value if (isShown || _isDiagnosticWindowShown) { Point newLocation = new Point { X = Screen.PrimaryScreen.Bounds.Width - _diagnosticWindow.Width, Y = 0 }; _diagnosticWindow.Location = newLocation; _diagnosticWindow.Show(); } } }