private void PasteUpControl_MouseUp(object sender, MouseEventArgs e) { if (_dragController == null) return; _dragController.EndDrag(); _dragController = null; Invalidate(); }
void PasteUpControl_MouseDown(object sender, MouseEventArgs e) { // Test hitting a handle first: if (_selectedFrame != null) { IHandleFlyweight handle = _selectedFrame.FindHitHandleOrNull(e.Location); if (handle != null) { _dragController = new DragController(e.Location, _selectedFrame, handle); _dragController.BeginDrag(); return; } } // Then try hitting a frame: DocumentFrame hitFrame = FindHitFrameOrNull(e.Location); if (_selectedFrame != hitFrame) { _selectedFrame = hitFrame; if (SelectedFrameChanged != null) SelectedFrameChanged(this, EventArgs.Empty); Invalidate(); } }