public void UpdateDrag(Point firstPoint, Point currentPoint, Size delta, DocumentFrame frame, DocumentFrameMemento memento) { LabelDocumentFrame labelFrame = (LabelDocumentFrame)frame; labelFrame.RestoreFromMemento(memento); labelFrame.CallOutOffsetInDocument += delta; }
public DragController(Point firstPoint, DocumentFrame frame, IHandleFlyweight handle) { _firstPoint = firstPoint; _frame = frame; _handle = handle; _memento = frame.CreateMemento(); }
public override void RestoreFromMemento(DocumentFrameMemento memento) { memento.Restore(this); }
public abstract void RestoreFromMemento(DocumentFrameMemento memento);
public void UpdateDrag(Point firstPoint, Point currentPoint, Size delta, DocumentFrame frame, DocumentFrameMemento memento) { frame.RestoreFromMemento(memento); frame.OffsetInDocument += delta; }
public void UpdateDrag(Point firstPoint, Point currentPoint, Size delta, DocumentFrame frame, DocumentFrameMemento memento) { RectangularDocumentFrame rectangularFrame = (RectangularDocumentFrame)frame; frame.RestoreFromMemento(memento); Rectangle clipBounds = rectangularFrame.ClipBounds; if (_isEast) clipBounds.Width += delta.Width; if (_isSouth) { clipBounds.Y += delta.Height; clipBounds.Height -= delta.Height; } if (_isWest) { clipBounds.X += delta.Width; clipBounds.Width -= delta.Width; } if (_isNorth) clipBounds.Height += delta.Height; clipBounds.Intersect(rectangularFrame.ObjectBounds); rectangularFrame.ClipBounds = clipBounds; }