Exemplo n.º 1
0
        public void Publish(ReportSeverity reportSeverity)
        {
            // If we need a new line then add it.
            OtherUtils.ConsoleGotoNewLine();

            // Give errors or warnings in standard form.
            var ttb = new TitledTextBuilder();

            ttb.Append(_reportTitles[reportSeverity], _genreDescriptions[this.ReportGenre]);

            // If given, write reason.
            if (!this.Reason.IsNullOrEmpty())
            {
                ttb.Append("Reason", this.Reason);
            }

            // If given, write location.
            if (!this.Location.IsNullOrEmpty())
            {
                ttb.Append("Location", this.Location);
            }

            if (reportSeverity == ReportSeverity.Error)
            {
                Console.Error.WriteLine($"\n{ttb}");
            }
            else
            {
                Console.Write($"\n{ttb}");
            }
        }
Exemplo n.º 2
0
        public static void NewStatus(string message)
        {
            if (Verbose < 2)
            {
                return;
            }

            OtherUtils.ConsoleGotoNewLine();
            Console.Write(message);
        }
Exemplo n.º 3
0
        public static void Message(string title, string text)
        {
            if (Verbose < 3)
            {
                return;
            }

            var ttb = new TitledTextBuilder();

            ttb.Append(title, text);
            OtherUtils.ConsoleGotoNewLine();
            Console.Write(ttb.ToString());
        }
Exemplo n.º 4
0
 public static void MessageAndExit(string message)
 {
     OtherUtils.ConsoleGotoNewLine();
     Console.WriteLine(message);
     Environment.Exit(1);
 }