How to restore references with n-level undo

How to restore references with n-level undo

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


sai posted on Tuesday, July 17, 2007

Changing some property replaces reference, but I found that CanceEdit does not restore it to earlier reference. Is it possible, if yes then how to do that?

References I am replacing are derived classes of some base class.

Thanks

sai replied on Tuesday, July 17, 2007

UndoableBase.UndoChanges checks for DeclaringType and not ReflectedType which made me to move declaration of data members from base to derived class and replace property methods with abstract methods in base class.

Is there any workaround to avoid this?

 

RockfordLhotka replied on Tuesday, July 17, 2007

Changing a child reference from one editable child to another editable child isn't supported by n-level undo.

N-level undo will revert your child reference to null/Nothing, but it won't revert your reference to some other child.

If you need that behavior, the child must be contained in a BusinessListBase collection, because BLB does include code to revert a child reference to a previous child.

Copyright (c) Marimer LLC