public void ConfigureDrawing(AbstractDrawing drawing, Action refresh) { Keyframe keyframe = metadata.HitKeyframe; IDecorable decorable = drawing as IDecorable; if (keyframe == null || drawing == null || decorable == null) { return; } HistoryMementoModifyDrawing memento = new HistoryMementoModifyDrawing(metadata, keyframe.Id, drawing.Id, drawing.Name, SerializationFilter.Style); FormConfigureDrawing2 fcd = new FormConfigureDrawing2(decorable, refresh); FormsHelper.Locate(fcd); fcd.ShowDialog(); if (fcd.DialogResult == DialogResult.OK) { memento.UpdateCommandName(drawing.Name); metadata.HistoryStack.PushNewCommand(memento); } fcd.Dispose(); }
public override HistoryMemento PerformUndo() { HistoryMemento redoMemento = new HistoryMementoModifyDrawing(metadata, managerId, drawingId, drawingName, filter); DrawingSerializer.DeserializeModifyMemento(managerId, drawingId, data, metadata); metadata.ModifiedDrawing(managerId, drawingId); return(redoMemento); }