ImageGlass.ImageBox.GetZoomLevel C# (CSharp) Method

GetZoomLevel() private method

Returns an appropriate zoom level based on the specified action, relative to the current zoom level.
Thrown if an unsupported action is specified.
private GetZoomLevel ( ImageBoxZoomActions action ) : int
action ImageBoxZoomActions The action to determine the zoom level.
return int
        private int GetZoomLevel(ImageBoxZoomActions action)
        {
            int result;

            switch (action)
            {
                case ImageBoxZoomActions.None:
                    result = Zoom;
                    break;
                case ImageBoxZoomActions.ZoomIn:
                    result = ZoomLevels.NextZoom(Zoom);
                    break;
                case ImageBoxZoomActions.ZoomOut:
                    result = ZoomLevels.PreviousZoom(Zoom);
                    break;
                case ImageBoxZoomActions.ActualSize:
                    result = 100;
                    break;
                default:
                    throw new ArgumentOutOfRangeException("action");
            }

            return result;
        }
ImageBox