ExecutingHistoryMementoEventArgs.cs 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. using System;
  2. namespace PaintDotNet.Measurement
  3. {
  4. public class ExecutingHistoryMementoEventArgs : EventArgs
  5. {
  6. private HistoryMemento historyMemento;
  7. private bool mayAlterSuspendToolProperty;
  8. private bool suspendTool;
  9. public HistoryMemento HistoryMemento
  10. {
  11. get
  12. {
  13. return this.historyMemento;
  14. }
  15. }
  16. public bool MayAlterSuspendTool
  17. {
  18. get
  19. {
  20. return this.mayAlterSuspendToolProperty;
  21. }
  22. }
  23. public bool SuspendTool
  24. {
  25. get
  26. {
  27. return this.suspendTool;
  28. }
  29. set
  30. {
  31. if (!this.mayAlterSuspendToolProperty)
  32. {
  33. throw new InvalidOperationException("May not alter the SuspendTool property when MayAlterSuspendToolProperty is false");
  34. }
  35. this.suspendTool = value;
  36. }
  37. }
  38. public ExecutingHistoryMementoEventArgs(HistoryMemento historyMemento, bool mayAlterSuspendToolProperty, bool suspendTool)
  39. {
  40. this.historyMemento = historyMemento;
  41. this.mayAlterSuspendToolProperty = mayAlterSuspendToolProperty;
  42. this.suspendTool = suspendTool;
  43. }
  44. }
  45. }