UnitsComboBoxStrip.cs 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  1. using System;
  2. using System.Windows.Forms;
  3. namespace PaintDotNet
  4. {
  5. public sealed class UnitsComboBoxStrip
  6. : ToolStripComboBox,
  7. IUnitsComboBox
  8. {
  9. private UnitsComboBoxHandler comboBoxHandler;
  10. public UnitsComboBoxStrip()
  11. {
  12. this.comboBoxHandler = new UnitsComboBoxHandler(this.ComboBox);
  13. }
  14. public UnitsDisplayType UnitsDisplayType
  15. {
  16. get
  17. {
  18. return this.comboBoxHandler.UnitsDisplayType;
  19. }
  20. set
  21. {
  22. this.comboBoxHandler.UnitsDisplayType = value;
  23. }
  24. }
  25. public bool LowercaseStrings
  26. {
  27. get
  28. {
  29. return this.comboBoxHandler.LowercaseStrings;
  30. }
  31. set
  32. {
  33. this.comboBoxHandler.LowercaseStrings = value;
  34. }
  35. }
  36. public MeasurementUnit Units
  37. {
  38. get
  39. {
  40. return this.comboBoxHandler.Units;
  41. }
  42. set
  43. {
  44. this.comboBoxHandler.Units = value;
  45. }
  46. }
  47. public string UnitsText
  48. {
  49. get
  50. {
  51. return this.comboBoxHandler.UnitsText;
  52. }
  53. }
  54. public bool PixelsAvailable
  55. {
  56. get
  57. {
  58. return this.comboBoxHandler.PixelsAvailable;
  59. }
  60. set
  61. {
  62. this.comboBoxHandler.PixelsAvailable = value;
  63. }
  64. }
  65. public bool InchesAvailable
  66. {
  67. get
  68. {
  69. return this.comboBoxHandler.InchesAvailable;
  70. }
  71. }
  72. public bool MilsAvailable
  73. {
  74. get
  75. {
  76. return this.comboBoxHandler.MilsAvailable;
  77. }
  78. }
  79. public bool CentimetersAvailable
  80. {
  81. get
  82. {
  83. return this.comboBoxHandler.CentimetersAvailable;
  84. }
  85. }
  86. public void RemoveUnit(MeasurementUnit removeMe)
  87. {
  88. this.comboBoxHandler.AddUnit(removeMe);
  89. }
  90. public void AddUnit(MeasurementUnit addMe)
  91. {
  92. this.comboBoxHandler.AddUnit(addMe);
  93. }
  94. public event EventHandler UnitsChanged
  95. {
  96. add
  97. {
  98. this.comboBoxHandler.UnitsChanged += value;
  99. }
  100. remove
  101. {
  102. this.comboBoxHandler.UnitsChanged -= value;
  103. }
  104. }
  105. }
  106. }