You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

LogViewerConfig.cs 1.6 kB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. using System;
  2. using System.Drawing;
  3. namespace Shadowsocks.Model
  4. {
  5. [Serializable]
  6. public class LogViewerConfig
  7. {
  8. public string fontName;
  9. public float fontSize;
  10. public string bgColor;
  11. public string textColor;
  12. public bool topMost;
  13. public bool wrapText;
  14. public bool toolbarShown;
  15. public LogViewerConfig()
  16. {
  17. this.fontName = "Console";
  18. this.fontSize = 8;
  19. this.bgColor = "black";
  20. this.textColor = "white";
  21. this.topMost = false;
  22. this.wrapText = false;
  23. this.toolbarShown = false;
  24. }
  25. public Color GetBackgroundColor()
  26. {
  27. try
  28. {
  29. return ColorTranslator.FromHtml(bgColor);
  30. }
  31. catch (Exception)
  32. {
  33. return ColorTranslator.FromHtml("black");
  34. }
  35. }
  36. public void SetBackgroundColor(Color color)
  37. {
  38. bgColor = ColorTranslator.ToHtml(color);
  39. }
  40. public Color GetTextColor()
  41. {
  42. try
  43. {
  44. return ColorTranslator.FromHtml(textColor);
  45. }
  46. catch (Exception)
  47. {
  48. return ColorTranslator.FromHtml("white");
  49. throw;
  50. }
  51. }
  52. public void SetTextColor(Color color)
  53. {
  54. textColor = ColorTranslator.ToHtml(color);
  55. }
  56. }
  57. }