/// <summary> /// Adds the specified importance. /// </summary> /// <param name="importance">The importance.</param> /// <param name="format">The format.</param> /// <param name="args">The args.</param> /// <returns></returns> /// <remarks></remarks> public Output Add(OutputImportance importance, [NotNull] string format, [NotNull] params object[] args) { Output o = new Output(importance, format, args); _outputs.Add(o); switch (importance) { case OutputImportance.Error: HasErrors = true; break; case OutputImportance.Warning: HasWarnings = true; break; } return(o); }
static void WriteLine(string str = "", OutputImportance type = OutputImportance.Important) { switch (type) { case OutputImportance.Error: Console.ForegroundColor = ConsoleColor.Red; break; case OutputImportance.Highlight: Console.ForegroundColor = ConsoleColor.Cyan; break; case OutputImportance.Important: Console.ForegroundColor = ConsoleColor.White; break; case OutputImportance.Verbose: Console.ForegroundColor = ConsoleColor.DarkGray; break; } Console.WriteLine(str); Console.ResetColor(); }
/// <summary> /// Initializes a new instance of the <see cref="Output"/> struct. /// </summary> /// <param name="importance">The importance.</param> /// <param name="format">The format.</param> /// <param name="args">The args.</param> /// <remarks></remarks> public Output(OutputImportance importance, [NotNull] string format, [NotNull] params object[] args) { Importance = importance; Message = string.Format(format, args); }
/// <summary> /// Added for testing issue #27. A method in this project using a type from /// another project as a constant, for the default value of the parameter. /// </summary> /// <param name="importance">The importance.</param> public void SomeMethod(OutputImportance importance = OutputImportance.Error) { }