SnapDescription.cs 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. using System;
  2. namespace PaintDotNet
  3. {
  4. public sealed class SnapDescription
  5. {
  6. private SnapObstacle snappedTo;
  7. private HorizontalSnapEdge horizontalEdge;
  8. private VerticalSnapEdge verticalEdge;
  9. private int xOffset;
  10. private int yOffset;
  11. public SnapObstacle SnappedTo
  12. {
  13. get
  14. {
  15. return this.snappedTo;
  16. }
  17. }
  18. public HorizontalSnapEdge HorizontalEdge
  19. {
  20. get
  21. {
  22. return this.horizontalEdge;
  23. }
  24. set
  25. {
  26. this.horizontalEdge = value;
  27. }
  28. }
  29. public VerticalSnapEdge VerticalEdge
  30. {
  31. get
  32. {
  33. return this.verticalEdge;
  34. }
  35. set
  36. {
  37. this.verticalEdge = value;
  38. }
  39. }
  40. public int XOffset
  41. {
  42. get
  43. {
  44. return this.xOffset;
  45. }
  46. set
  47. {
  48. this.xOffset = value;
  49. }
  50. }
  51. public int YOffset
  52. {
  53. get
  54. {
  55. return this.yOffset;
  56. }
  57. set
  58. {
  59. this.yOffset = value;
  60. }
  61. }
  62. public SnapDescription(
  63. SnapObstacle snappedTo,
  64. HorizontalSnapEdge horizontalEdge,
  65. VerticalSnapEdge verticalEdge,
  66. int xOffset,
  67. int yOffset)
  68. {
  69. if (snappedTo == null)
  70. {
  71. throw new ArgumentNullException("snappedTo");
  72. }
  73. this.snappedTo = snappedTo;
  74. this.horizontalEdge = horizontalEdge;
  75. this.verticalEdge = verticalEdge;
  76. this.xOffset = xOffset;
  77. this.yOffset = yOffset;
  78. }
  79. }
  80. }