private void View_MultiDrawingItemAdding(object sender, MultiDrawingItemEventArgs e) { HistoryMemento memento = new HistoryMementoAddMultiDrawingItem(frameServer.Metadata, e.Manager, e.Item.Id); frameServer.Metadata.AddMultidrawingItem(e.Manager, e.Item); historyStack.PushNewCommand(memento); }
public override HistoryMemento PerformUndo() { HistoryMemento redoMemento = new HistoryMementoAddMultiDrawingItem(metadata, manager, itemId); redoMemento.CommandName = commandName; AbstractMultiDrawingItem item = MultiDrawingItemSerializer.DeserializeMemento(data, metadata); metadata.AddMultidrawingItem(manager, item); // TODO: re instate the associated trackable drawing. return(redoMemento); }