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; _dragAndDropGestureHandler?.Dispose(); _dragAndDropGestureHandler = null; } base.Dispose(disposing); }
public InnerGestureListener( TapGestureHandler tapGestureHandler, PanGestureHandler panGestureHandler, SwipeGestureHandler swipeGestureHandler, DragAndDropGestureHandler dragAndDropGestureHandler) { _ = tapGestureHandler ?? throw new ArgumentNullException(nameof(tapGestureHandler)); _ = panGestureHandler ?? throw new ArgumentNullException(nameof(panGestureHandler)); _ = swipeGestureHandler ?? throw new ArgumentNullException(nameof(swipeGestureHandler)); _ = dragAndDropGestureHandler ?? throw new ArgumentNullException(nameof(dragAndDropGestureHandler)); _tapGestureHandler = tapGestureHandler; _panGestureHandler = panGestureHandler; _swipeGestureHandler = swipeGestureHandler; _dragAndDropGestureHandler = dragAndDropGestureHandler; _tapDelegate = tapGestureHandler.OnTap; _tapGestureRecognizers = tapGestureHandler.TapGestureRecognizers; _scrollDelegate = panGestureHandler.OnPan; _scrollStartedDelegate = panGestureHandler.OnPanStarted; _scrollCompleteDelegate = panGestureHandler.OnPanComplete; _swipeDelegate = swipeGestureHandler.OnSwipe; _swipeCompletedDelegate = swipeGestureHandler.OnSwipeComplete; }