OddNumber.cs 1.2 KB

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