This project is read-only.


Addative Commands


Sometimes one wants to have a command that they can start & commit but then commit (or add) some more changes later.
One example would be moving a graphical figure via the keyboard arrow keys, each time you press the arrow key you would like to add the new changes to the last batch.
I have posted my method of accomplising this in the attached file (modified UndoRedoArea.cs). It adds two extra public methods to UndoRedoArea called "StartSpan" & "CommitSpan".

file attachments

Closed Jul 15, 2011 at 6:18 AM by SergeiArhipenko
Released in v1.0


SergeiArhipenko wrote Jun 6, 2008 at 5:30 PM

I have implemented this feature in beta 1 release.
I done it in a little bit different manner through adding method Start with additional parameter:
Start(string commandCaption, object owner)

All you need is a passing the main object you operate as an owner parameter. You may pass any object there - it will be used as an identifier for checking of commands affinity. Commands are automaticaly merged if affinity detected.

Hope, you will find it convinient.

wrote Jun 6, 2008 at 5:31 PM

wrote Jun 6, 2008 at 6:24 PM

wrote Jul 15, 2011 at 6:18 AM

wrote Feb 13, 2013 at 11:58 PM

wrote May 16, 2013 at 5:53 AM