Undo/redo

Hi,
I’m currently penetrating the universum of undo/redo. I works just fine but I have one problem. When a certain link is deleted from my document I want to delete some other objects in the same transaction. What happens now is that when the link gets deleteted I get notified in GoView.DeleteSelection. There I use StartTransaction, then deletes the other objects, then FinishTransaction. All the objects (incl. the link) disappear from the document (so far, so good). However, if I now undo my last change only my “extra-objects” reappear (i.e. not the link).
Where shall I hook in to become a part of the “delete-link”-transaction?

Regards / Mattias

Are you overriding GoView.DeleteSelection? That probably isn’t what you want to do, since the implementation of DeleteSelection starts and finishes a transaction, and performing a transaction after DeleteSelection finishes just means you have two separate transactions. Which would explain the behavior you see.
Instead define a GoView.SelectionDeleting handler, so you can see the objects in the GoView.Selection. Your actions will happen within the transaction established by GoView.DeleteSelection.