public void StopOperation(bool commit)
 {
     if (!_done)
     {
         _done = true;
         _ui._parent.Canvas.Children.Remove(_visualizer);
         _ui.MouseMove -= HandleMouseMove;
         _ui.MouseUp   -= HandleMouseUp;
         _ui.ReleaseMouseCapture();
         if (commit && (_startPoint - _p0).Length > 2)
         {
             if (!_moveEndingSuccessful)
             {
                 _movingPointDocking = ConnectorDocking.Undefined;
                 _newMoveDistance    = 0.5;
                 _otherPointDocking  = ConnectorDocking.Undefined;
             }
             _moveHelper.Commit(_movingPointDocking, _otherPointDocking, _movePointStart, _otherPointPosition, _newMoveDistance);
         }
         else
         {
             _ui.DropSnapshot();
         }
         _ui.UpdateGeometry();
     }
 }
 public void OnKeyDown(System.Windows.Input.KeyEventArgs e)
 {
     if (e.Key == System.Windows.Input.Key.Escape)
     {
         _ui.DropSnapshot();
         StopOperation(false);
     }
 }