Alteridem.WinTouch.Demo.GestureControl.OnPan C# (CSharp) Method

OnPan() private method

private OnPan ( object sender, PanEventArgs e ) : void
sender object
e PanEventArgs
return void
        void OnPan( object sender, PanEventArgs e )
        {
            string msg = string.Format( "Pan Loc:({0},{1}) InertiaVector:({2},{3})", e.Location.X, e.Location.Y,
                                       e.InertiaVector.X, e.InertiaVector.Y );
            Debug.WriteLine( msg );

            if ( !e.Begin )
            {
                _location.Offset( e.PanOffset );

                // Make sure it doesn't leave the screen
                if ( _location.X < 0 )
                    _location.X = 0;
                else if ( _location.X > Width )
                    _location.X = Width;

                if ( _location.Y < 0 )
                    _location.Y = 0;
                else if ( _location.Y > Height )
                    _location.Y = Height;

                Invalidate();
            }
        }