void _leftMouseDownListener_LockAxis(object sender, SysMouseEventInfo e)
        {
            try
            {
                var p = System.Windows.Forms.Control.MousePosition;
                var currentSlide = this.GetCurrentSlide();
                var selectedShape = GetShapeDirectlyBelowMousePos(_allShapesInSlide, p);

                if (selectedShape == null)
                {
                    DisableLockAxisMode();
                    return;
                }

                var isShapeToBeMoved = _shapesToBeMoved.Contains(selectedShape);

                if (!isShapeToBeMoved)
                {
                    DisableLockAxisMode();
                    return;
                }

                this.StartNewUndoEntry();

                _initialPos = new float[_shapesToBeMoved.Count, 2];
                for (var i = 0; i < _shapesToBeMoved.Count; i++)
                {
                    var s = _shapesToBeMoved[i];
                    _initialPos[i, Left] = s.Left;
                    _initialPos[i, Top] = s.Top;
                }

                _initialMousePos = p;
                _dispatcherTimer.Start();
            }
            catch (Exception ex)
            {
                Logger.LogException(ex, "LockAxis");
            }
        }
 void _leftMouseUpListener_LockAxis(object sender, SysMouseEventInfo e)
 {
     _dispatcherTimer.Stop();
 }
 void _leftMouseUpListener_Rotation(object sender, SysMouseEventInfo e)
 {
     _dispatcherTimer.Stop();
 }
        void _leftMouseDownListener_Rotation(object sender, SysMouseEventInfo e)
        {
            try
            {
                var p = System.Windows.Forms.Control.MousePosition;
                var selectedShape = GetShapeDirectlyBelowMousePos(_allShapesInSlide, p);

                if (selectedShape == null)
                {
                    DisableRotationMode();
                    return;
                }

                var isShapeToBeRotated = _shapesToBeRotated.Contains(selectedShape);
                var isRefPoint = _refPoint.Id == selectedShape.Id;

                if (!isShapeToBeRotated && !isRefPoint)
                {
                    DisableRotationMode();
                    return;
                }

                this.StartNewUndoEntry();

                if (isRefPoint)
                {
                    this.GetCurrentSelection().Unselect();
                    return;
                }

                _prevMousePos = p;
                _dispatcherTimer.Start();
            }
            catch (Exception ex)
            {
                Logger.LogException(ex, "Rotation");
            }
        }
Пример #5
0
 void _native_LButtonClicked(object sender, SysMouseEventInfo e)
 {
     _native.Close();
     timer1.Stop();
     //this is to ensure that EyeDropper tool feature doesn't
     //affect Color Dialog tool feature
     if (_timerCounter >= TIMER_COUNTER_THRESHOLD)
     {
         Globals.ThisAddIn.Application.StartNewUndoEntry();
         UpdateUIForNewColor();
         if (currMode != MODE.NONE)
         {
             ColorSelectedShapesWithColor(_pickedColor);
         }
     }
     _timerCounter = 0;
     ResetEyeDropperSelectionInDataSource();
 }