Example #1
0
 /// <summary>
 /// Event that fires whenever the log gets updated
 /// </summary>
 /// <param name="data">The new log data</param>
 private void LogUpdated(string data)
 {
     TxtLog.Text = data;
     if (_scrollToEnd)
     {
         TxtLog.ScrollToEnd();
     }
 }
Example #2
0
 private void FileWorkerWorkCompleted(object sender, EventArgs e)
 {
     TxtLog.AppendText(DateTime.Now + "\tEnd.\r\n");
     TxtLog.ScrollToEnd();
     BtnStart.IsEnabled = true;
     logList.Add(_dtoLog);
     Dispatcher.Invoke(new Action(SetServiceLabels));
 }
Example #3
0
        /// <summary>
        /// Appends the given string to the on-screen log, and the debug console.
        /// </summary>
        /// <param name="output">string to be appended</param>
        private async Task OutputAsync(string output)
        {
            await Dispatcher.InvokeAsync(() =>
            {
                TxtLog.AppendText(output + Environment.NewLine);
                TxtLog.ScrollToEnd();
            });

            Console.WriteLine(output);
        }
        private void UpdateLog(string text)
        {
            var message = "[ " + DateTime.Now.ToString() + " ]:  " + text + "\r\n";

            TxtLog.AppendText(message);
            if (TxtLog.Text.Length > 100000)
            {
                TxtLog.Text.Remove(0, 20000);
            }
            TxtLog.ScrollToEnd();
        }
Example #5
0
        private void LogChanges(string logEntry, LogType logType)
        {
            Dispatcher.Invoke(new Action(() =>
            {
                string color;
                switch (logType)
                {
                case LogType.Success:
                    color = "green";
                    break;

                case LogType.Error:
                    color = "red";
                    break;

                default:
                    color = "white";
                    break;
                }
                TxtLog.AppendText(DateTime.Now + "\t" + logEntry + "\r\n", color);
                TxtLog.ScrollToEnd();
            }));
        }
Example #6
0
 public void ShowLog(string inf)
 {
     TxtLog.AppendText(inf);
     TxtLog.ScrollToEnd();
 }