Disable n-level undo?

Disable n-level undo?

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


dagware posted on Friday, August 03, 2007

I swear I've read about this before, but I'll be darned if I can find exactly what I need to do to disable n-level undo. I have some special-case CSLA objects for which n-level undo is not needed, nor desired. It seems that the binding source automatically calls BeginEdit, so I'm looking for the "correct" way to turn this off.

Can someone either tell me how, or point me to the information that I'm obviously too search-challanged to find? Thanks!!

Dan

RockfordLhotka replied on Saturday, August 04, 2007

The ability to disable IEditableObject (prevent data binding from invoking n-level undo) is new in CSLA 3.0. Some people have implemented this change themselves, but this is the first time it is directly in the framework.

I'll be fully documenting the change, and its ramifications, in the 3.0 ebook, but the property you are looking for is DisableIEditableObject, which is a protected property of BusinessBase. Set that to True and call calls to IEditableObject methods are totally ignored.

Be aware that n-level undo itself is "disabled" unless someone calls BeginEdit(). That could be data binding through IEditableObject, or directly by you.

So disabling IEditableObject does effectively "disable" n-level undo as long as you don't call BeginEdit() yourself.

And remember that some UI concepts (like in-place editing in a grid) simply won't work right without IEditableObject.

dagware replied on Saturday, August 04, 2007

RockfordLhotka:

And remember that some UI concepts (like in-place editing in a grid) simply won't work right without IEditableObject.


Thanks for the reply. The term "remember" implies that I already knew that, which I didn't, so thanks for the heads-up! I guess I probably don't want to disable it after all.

Learn something every day... Thanks.

Dan

Copyright (c) Marimer LLC