Everytime the IWpfTextView’s TextBuffer changes I am trying to get the history’s redostack and undostack and simply checking the count. When doing this I am encountering a “Method not supported exception” when trying to access the two stacks.
Am I retrieving the history incorrectly or does VS not want me seeing/editing the contents of the stacks?
I can post the code if necessary…
Thanks,
Nick
It’s probably because the editor’s undo history implementation in VS is a thin wrapper on top of the general VS undo history. I’d guess that
Countisn’t implemented on the editor’s text undo history because there isn’t an implementation on the VS undo history (IOleUndoManageronly supports enumeration, so implementingCountwould be expensive).In general, though, it doesn’t want you editing the contents of the stacks. If the undo stack gets out of sync with the text buffer, it’ll essentially break undo and make small, cute animals cry.
It may help if you describe what you are trying to do, and then I can give better answers for how to accomplish that.