DebugConsoleWriter.cs 859 B

123456789101112131415161718192021222324252627282930313233343536
  1. using System;
  2. using Quadarax.Foundation.Core.Console;
  3. namespace Quadarax.Foundation.Core.QConsole
  4. {
  5. public class DebugConsoleWriter : ConsoleWriter
  6. {
  7. public static bool IsWriteDebugEnabled { get; set; }
  8. public DebugConsoleWriter(ConsoleColor backColor) : base(Defaults.Console.ConsoleDebugForeColor, backColor)
  9. {
  10. }
  11. public DebugConsoleWriter() : base(Defaults.Console.ConsoleDebugForeColor)
  12. {
  13. }
  14. public ConsoleWriter WriteDebugLine(string text)
  15. {
  16. if (IsWriteDebugEnabled)
  17. {
  18. WriteLine(text);
  19. }
  20. return this;
  21. }
  22. public ConsoleWriter WriteDebugLine()
  23. {
  24. if (IsWriteDebugEnabled)
  25. {
  26. WriteLine();
  27. }
  28. return this;
  29. }
  30. }
  31. }