Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Adding an Undo command without executing it (Read 1079 times)
j poz
Junior Member
**
Offline


I Love MindFusion!

Posts: 78
Joined: Nov 21st, 2012
Adding an Undo command without executing it
Mar 11th, 2013 at 4:35pm
Print Post  
Is it possible to add an undo command to the UndoManager without executing it?

Something like UndoManager.Commands.Add(...)... ?
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Adding an Undo command without executing it
Reply #1 - Mar 11th, 2013 at 5:19pm
Print Post  
I can't find a public method to do that. If it's a custom command, you could implement Execute(bool) as empty method, and override only Redo to execute the action (by default Redo calls Execute). If you need this for standard commands, at this time you could wrap them inside some kind of NoopExecCommand that does not call the inner Execute but calls Undo and Redo.

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint