public void UpdateDrag(Point firstPoint, Point currentPoint, Size delta, DocumentFrame frame, DocumentFrameMemento memento)
        {
            LabelDocumentFrame labelFrame = (LabelDocumentFrame)frame;

            labelFrame.RestoreFromMemento(memento);
            labelFrame.CallOutOffsetInDocument += delta;
        }
예제 #2
0
 public DragController(Point firstPoint, DocumentFrame frame, IHandleFlyweight handle)
 {
     _firstPoint = firstPoint;
     _frame = frame;
     _handle = handle;
     _memento = frame.CreateMemento();
 }
예제 #3
0
 public override void RestoreFromMemento(DocumentFrameMemento memento)
 {
     memento.Restore(this);
 }
예제 #4
0
 public abstract void RestoreFromMemento(DocumentFrameMemento memento);
예제 #5
0
 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;
        }