コード例 #1
0
        /// <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);
        }
コード例 #2
0
        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();
        }
コード例 #3
0
ファイル: Output.cs プロジェクト: webappsuk/CoreLibraries
 /// <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);
 }
コード例 #4
0
 /// <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)
 {
 }
コード例 #5
0
ファイル: Output.cs プロジェクト: webappsuk/CoreLibraries
 /// <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);
 }