How to actualize the N-Level Undo

How to actualize the N-Level Undo

Old forum URL: forums.lhotka.net/forums/t/5271.aspx


future_zheng posted on Wednesday, August 20, 2008

ajj3085 replied on Wednesday, August 20, 2008

Take the BeginEdit out.  It's not needed, and as you can see causes problem.

If you want form level undo, I think you'll need to call BeginEdit on your BO, but BEFORE you do the databinding.  To CancelEdit, you'll have to unbind the BO before you call the Cancel (or End). 

Once databound, databinding handles calling Begin / Cancel and End edit for the user.  You don't need to do any work there, it's done automatically unless you disabled support for databinding undo.

future_zheng replied on Wednesday, August 20, 2008

Thanks for you suggest.Please allow to explain my think.I want to actualize like word .After I input three times,if I call undo function for three times,I will return to initiation location.

RockfordLhotka replied on Wednesday, August 20, 2008

The undo feature of CSLA .NET doesn't work like that in Word.

Word uses a command-based undo structure, where they undo changes command-by-command.

CSLA uses a snapshot-based undo structure, where a snapshot of the object is taken, and then an undo goes back to that snapshot.

future_zheng replied on Thursday, August 21, 2008

Thanks for Rocky's reply

Copyright (c) Marimer LLC