private void MouseDown(MouseEventArgs e, EventHandleStatus status) { Point viewPoint = _modelEditor.ToViewCoord(e.Location); if (e.Button == MouseButtons.Left) { IInternalSelection sel = _modelEditor.BindingEnvironment as IInternalSelection; //是否点中了锚点 _currentElement = sel.GetActionElementAt(viewPoint, out _currentAnchorIndex); if (_currentElement != null && _currentAnchorIndex != -1) { _startPoint = viewPoint; _prePoint = _startPoint; _oprType = enumOprType.Anchor; status.Handled = true; } else//点中了除锚点外的其它区域 { _currentElement = sel.Select(viewPoint); if (_currentElement != null) { _startPoint = viewPoint; _prePoint = _startPoint; _oprType = enumOprType.Move; status.Handled = true; } _modelEditor.Render(); } } }
private void MouseUp(MouseEventArgs e, EventHandleStatus status) { _prePoint = Point.Empty; _startPoint = Point.Empty; _currentElement = null; _currentAnchorIndex = -1; _oprType = enumOprType.None; }