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; }