CurveEditorCommands.cs 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. //-----------------------------------------------------------------------------
  2. // CurveEditorCommands.cs
  3. //
  4. // Microsoft XNA Community Game Platform
  5. // Copyright (C) Microsoft Corporation. All rights reserved.
  6. //-----------------------------------------------------------------------------
  7. using System;
  8. using System.Collections;
  9. using System.Collections.Generic;
  10. using System.Windows.Forms;
  11. namespace Xna.Tools
  12. {
  13. public class CurveAddRemoveCommand : ICommand
  14. {
  15. CurveEditor editor;
  16. ArrayList oldSelection;
  17. ArrayList newSelection;
  18. ArrayList newItems;
  19. ArrayList oldItems;
  20. public CurveAddRemoveCommand(CurveEditor editor,
  21. IList oldItems, IList newItems, IList oldSelection, IList newSelection)
  22. {
  23. // Copy selection list.
  24. this.editor = editor;
  25. this.oldItems = new ArrayList(oldItems);
  26. this.newItems = new ArrayList(newItems);
  27. this.oldSelection = new ArrayList(oldSelection);
  28. this.newSelection = new ArrayList(newSelection);
  29. }
  30. public void Execute()
  31. {
  32. editor.UpdateCurveItems(newItems, newSelection);
  33. }
  34. public void Unexecute()
  35. {
  36. editor.UpdateCurveItems(oldItems, oldSelection);
  37. }
  38. }
  39. }