LitDev.Engines.GraphEngine._MouseWheelEvent C# (CSharp) Method

_MouseWheelEvent() private method

private _MouseWheelEvent ( Object sender, System.Windows.Input.MouseWheelEventArgs e ) : void
sender Object
e System.Windows.Input.MouseWheelEventArgs
return void
        private void _MouseWheelEvent(Object sender, MouseWheelEventArgs e)
        {
            try
            {
                Canvas _plotarea = (Canvas)sender;
                Canvas _graph = (Canvas)_plotarea.Parent;
                plotData _plotData = getPlotData((string)_graph.Tag);

                if (null == _plotData.scaleArea && !mouseScrollX && !mouseScrollY)
                {
                    posDown.X = _plotarea.ActualWidth;
                    posDown.Y = _plotarea.ActualHeight;
                    posUp.X = _plotarea.ActualWidth;
                    posUp.Y = _plotarea.ActualHeight;
                    if (e.Delta > 0)
                    {
                        posDown.X *= -0.05;
                        posDown.Y *= -0.05;
                        posUp.X *= 1.05;
                        posUp.Y *= 1.05;
                    }
                    else if (e.Delta < 0)
                    {
                        posDown.X *= 0.05;
                        posDown.Y *= 0.05;
                        posUp.X /= 1.05;
                        posUp.Y /= 1.05;
                    }
                    plotSeries(_graph, _plotData, eZoom.TRUE, eRescale.FALSE);
                }
            }
            catch (Exception ex)
            {
                Utilities.OnError(Utilities.GetCurrentMethod(), ex);
            }
        }