Exemple #1
0
        public InnerGestureListener(TapGestureHandler tapGestureHandler, PanGestureHandler panGestureHandler, SwipeGestureHandler swipeGestureHandler)
        {
            if (tapGestureHandler == null)
            {
                throw new ArgumentNullException(nameof(tapGestureHandler));
            }

            if (panGestureHandler == null)
            {
                throw new ArgumentNullException(nameof(panGestureHandler));
            }

            if (swipeGestureHandler == null)
            {
                throw new ArgumentNullException(nameof(swipeGestureHandler));
            }

            _tapGestureHandler   = tapGestureHandler;
            _panGestureHandler   = panGestureHandler;
            _swipeGestureHandler = swipeGestureHandler;

            _tapDelegate            = tapGestureHandler.OnTap;
            _tapGestureRecognizers  = tapGestureHandler.TapGestureRecognizers;
            _scrollDelegate         = panGestureHandler.OnPan;
            _scrollStartedDelegate  = panGestureHandler.OnPanStarted;
            _scrollCompleteDelegate = panGestureHandler.OnPanComplete;
            _swipeDelegate          = swipeGestureHandler.OnSwipe;
            _swipeCompletedDelegate = swipeGestureHandler.OnSwipeComplete;
        }
Exemple #2
0
        protected override void Dispose(bool disposing)
        {
            if (_disposed)
            {
                return;
            }

            _disposed = true;

            if (disposing)
            {
                _panGestureHandler   = null;
                _swipeGestureHandler = null;
                _tapGestureHandler   = null;

                _tapDelegate            = null;
                _tapGestureRecognizers  = null;
                _scrollDelegate         = null;
                _scrollStartedDelegate  = null;
                _scrollCompleteDelegate = null;
                _swipeDelegate          = null;
                _swipeCompletedDelegate = null;
            }

            base.Dispose(disposing);
        }