using System; using System.Collections.Generic; using System.ComponentModel; using System.Drawing; using System.Data; using System.Text; using System.Windows.Forms; using IndianHealthService.BMXNet.Services; namespace IndianHealthService.BMXNet.Tools.ComponentTestBench { public partial class LogTranscriptControl : UserControl,Log { public LogTranscriptControl() { InitializeComponent(); } private bool _isLogging = true; public bool IsLogging { get { return _isLogging; } set { _isLogging = value; } } public delegate void UiLogDelegate(string aClass, string aCategory, params string[] lines); public void Log(string aClass, string aCategory, params string[] lines) { if (!this.IsLogging) { return; } // if (this.InvokeRequired) // { // this.Invoke(new UiLogDelegate(this.UiLog), aClass, aCategory, lines); // } // else // { this.UiLog(aClass, aCategory, lines); // } } protected void UiLog(string aClass, string aCategory, params string[] lines) { this.transcriptBox.AppendText("\r\n-------------------\r\n"); this.transcriptBox.AppendText(DateTime.Now.ToString("HH:MM:ss.mm").PadRight(12)+" "+aClass.PadRight(12) + " " + aCategory.PadRight(12)); if (lines.Length == 1) { this.transcriptBox.AppendText(" "); this.transcriptBox.AppendText(lines[0]); } else { for (int i=0;i