OddNumber.cs 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. using SmartCoalApplication.Base;
  2. using SmartCoalApplication.Core.CustomControl;
  3. using SmartCoalApplication.CustomControl;
  4. using System;
  5. using System.Windows.Forms;
  6. namespace SmartCoalApplication.Core.Param
  7. {
  8. /// <summary>
  9. /// 奇数范围
  10. /// </summary>
  11. public class OddNumber : Args
  12. {
  13. private int min;
  14. private int max;
  15. public void numberParam_ValueChanged(object sender, EventArgs e)
  16. {
  17. if (sender.GetType() == typeof(NumberParamControl))
  18. {
  19. this.Value = ((NumberParamControl)sender).Value;
  20. }
  21. else if (sender.GetType() == typeof(NumericUpDown))
  22. {
  23. this.Value = ((NumericUpDown)sender).Value;
  24. }
  25. }
  26. public OddNumber(int min, int max)
  27. {
  28. this.Type = Dtryt.Odd;
  29. this.min = min;
  30. this.max = max;
  31. }
  32. public int Min
  33. {
  34. get
  35. {
  36. return this.min;
  37. }
  38. set
  39. {
  40. this.min = value;
  41. }
  42. }
  43. public int Max
  44. {
  45. get
  46. {
  47. return this.max;
  48. }
  49. set
  50. {
  51. this.max = value;
  52. }
  53. }
  54. }
  55. }