示例#1
0
        private bool ProportionalPromptProportion(bool isForSameShapes = false)
        {
            var noOfShapes = GetSelectedShapes()?.Count;

            if (!noOfShapes.HasValue || noOfShapes < 2)
            {
                _errorHandler.ProcessErrorCode(ResizeLabErrorHandler.ErrorCodeInvalidSelection, ResizeLabMain.AdjustProportionally_ErrorParameters);
                return(false);
            }
            if (isForSameShapes)
            {
                var errorCode = IsValidShapes(GetSelectedShapes());

                if (errorCode != -1)
                {
                    _errorHandler.ProcessErrorCode(errorCode);
                    return(false);
                }
            }
            if (_adjustProportionallySettingsDialog == null || !_adjustProportionallySettingsDialog.IsOpen)
            {
                _adjustProportionallySettingsDialog = new AdjustProportionallySettingsDialog(_resizeLab, noOfShapes.GetValueOrDefault());
                _adjustProportionallySettingsDialog.ShowDialog();
            }
            else
            {
                _adjustProportionallySettingsDialog.Activate();
            }

            if (_resizeLab.AdjustProportionallyProportionList?.Count != noOfShapes.Value) // User probably closed the dialog
            {
                return(false);
            }
            return(true);
        }
        private bool ProportionalPromptProportion()
        {
            var noOfShapes = GetSelectedShapes()?.Count;
            if (!noOfShapes.HasValue || noOfShapes < 2)
            {
                _errorHandler.ProcessErrorCode(ResizeLabErrorHandler.ErrorCodeInvalidSelection, ResizeLabMain.AdjustProportionally_ErrorParameters);
                return false;
            }
            if (_adjustProportionallySettingsDialog == null || !_adjustProportionallySettingsDialog.IsOpen)
            {
                _adjustProportionallySettingsDialog = new AdjustProportionallySettingsDialog(_resizeLab, noOfShapes.GetValueOrDefault());
                _adjustProportionallySettingsDialog.ShowDialog();
            }
            else
            {
                _adjustProportionallySettingsDialog.Activate();
            }

            if (_resizeLab.AdjustProportionallyProportionList?.Count != noOfShapes.Value) // User probably closed the dialog
            {
                return false;
            }
            return true;
        }