UnitsComboBoxStrip.cs 2.4 KB

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