/// <summary> /// This method outputs a single TerminalMessage to the console with the given /// colors using Colorful.Console NuGet package. The appended string lines will /// be returned as well but with no color information. /// </summary> public static string WriteTerminalMessage(TerminalMessage message) { List <TerminalMessage> terminalMessages = new List <TerminalMessage>(); terminalMessages.Add(message); return(WriteTerminalMessages(terminalMessages)); }
/// <summary> /// The simplified string[] representation of WriteTerminalMessages() without specifying a color. /// </summary> public static string WriteTerminalMessages(string[] messages) { var terminalMessagesList = new List <TerminalMessage>(); foreach (var message in messages) { terminalMessagesList.Add(TerminalMessage.Create(message)); } return(WriteTerminalMessages(terminalMessagesList)); }
public static string WriteLocation() { if (false == LocationWritten) { var envPathMessage = string.Format(TerminalMessages.GeneralFileAccessErrorMessageEnvironmentPath, IoHelper.GetEnvironmentPath()); var execPathMessage = string.Format(TerminalMessages.GeneralFileAccessErrorMessageExecutionPath, IoHelper.GetExecutionPath()); var messages = new List <TerminalMessage>(); messages.Add(TerminalMessage.CreateEmpty()); messages.Add(TerminalMessage.Create(TerminalMessages.GeneralFileAccessErrorMessageInitial, Color.Red)); messages.Add(TerminalMessage.Create(envPathMessage)); messages.Add(TerminalMessage.Create(execPathMessage)); LocationWritten = true; return(WriteTerminalMessages(messages)); } return(string.Empty); }