Example #1
0
        /// <summary>
        /// Appends a line of text (CRLF added automatically) both to the logged output (<see cref="FormStatus.GetOutputString"/>) and to the display console control.
        /// </summary>
        public void AppendOutputLine(string line)
        {
            // To the internal log (which can be then retrieved as full text from this form)
            OutputLog.AppendLine(line);

            // To the display control
            AddMessageLine(line);
        }
Example #2
0
        private void DataReceivedCore(object sender, TextEventArgs e)
        {
            if (e.Text.Contains("%") || e.Text.Contains("remote: Counting objects"))
            {
                SetProgress(e.Text);
            }
            else
            {
                const string ansiSuffix = "\u001B[K";
                string       line       = e.Text.Replace(ansiSuffix, "");

                if (ConsoleOutput.IsDisplayingFullProcessOutput)
                {
                    OutputLog.AppendLine(line);                 // To the log only, display control displays it by itself
                }
                else
                {
                    AppendOutputLine(line);                 // Both to log and display control
                }
            }

            DataReceived(sender, e);
        }