public void Log(object sender, Logging.LogEventArgs e) { if (InvokeRequired) { var hnd = new EventHandler <Logging.LogEventArgs>(Log); Invoke(hnd, new object[] { sender, e }); return; } //logText.AppendText(e.Text + Environment.NewLine); //logText.SelectionStart = logText.TextLength; //logText.ScrollToCaret(); }
private void Server_Log(object sender, Logging.LogEventArgs e) { if (InvokeRequired) { EventHandler <Logging.LogEventArgs> hnd = new EventHandler <Logging.LogEventArgs>(Server_Log); Invoke(hnd, new object[] { sender, e }); return; } logText.AppendText(e.Text + Environment.NewLine); logText.SelectionStart = logText.TextLength; logText.ScrollToCaret(); }
private void Client_Log(object sender, Logging.LogEventArgs e) { if (InvokeRequired) { EventHandler <Logging.LogEventArgs> hnd = new EventHandler <Logging.LogEventArgs>(Client_Log); Invoke(hnd, new object[] { sender, e }); return; } logText.AppendText(e.Text + System.Environment.NewLine); var lines = (from item in logText.Text.Split('\n') select item.Trim()); int count = 24; lines = lines.Skip(Math.Max(0, lines.Count() - count)); logText.Text = string.Join(System.Environment.NewLine, lines.ToArray()); logText.SelectionStart = logText.TextLength; logText.ScrollToCaret(); }
private void SolverLogging(object sender, Logging.LogEventArgs logEventArgs) { logSolver.ReportMessage(logEventArgs.Message, logEventArgs.Type, logEventArgs.Newline); }