Exemple #1
0
        /// <summary>
        /// Called when [error].
        /// </summary>
        /// <param name="ex">The error exception.</param>
        public virtual void OnError(Exception ex)
        {
            ConsoleColorManager.SetForegroundColor(ConsoleColor.DarkRed);

            // show all of the exception messages including all internal exceptions
            try {
                while (ex != null)
                {
                    Console.WriteLine(ex.Message);
                    ex = ex.InnerException;
                }
            } finally {
                ConsoleColorManager.RestoreForegroundColor();
            }
        }
Exemple #2
0
 /// <summary>
 /// Called when [no such command].
 /// </summary>
 /// <param name="noSuchCommand">The no such command.</param>
 public virtual void OnNoSuchCommand(NoSuchCommandException noSuchCommand)
 {
     ConsoleColorManager.SetForegroundColor(ConsoleColor.DarkRed);
     Console.WriteLine("{0}: command not found.", noSuchCommand.CommandName);
     ConsoleColorManager.RestoreForegroundColor();
 }