1

Closed

UndoRedoList<T>.Clear() does not clear the list if a change has already been recorded for the list

description

If there are changes already recorded for an UndoRedoList<T> then when calling Clear(), it doesn't actually clear the list. It appears the item is already Enlisted in the currentCommand changes such that when you call Enlist(false), it skips the section where a new list is instantiated thereby clearing the list.
 
A workaround is to cast the UndoRedoList<T> to an IList. The IList.Clear() is implemented correctly.
Closed Jul 15, 2011 at 5:18 AM by SergeiArhipenko
Released in v1.0

comments

sha0skywalker wrote May 2, 2008 at 3:11 PM

I believe the fix is just to add a list.Clear() after the Enlist call in the UndoRedoList<T>.Clear() call

SergeiArhipenko wrote Jun 6, 2008 at 9:51 AM

will put in beta 1

wrote Jun 6, 2008 at 9:51 AM

wrote Jun 6, 2008 at 5:24 PM

wrote Jul 15, 2011 at 5:18 AM

wrote Feb 13, 2013 at 10:58 PM

wrote May 16, 2013 at 4:53 AM