public void Cancel()
 {
     if (_capturedHandler != null)
     {
         _capturedHandler.Cancel();
         _capturedHandler = null;
     }
 }
예제 #2
0
        /// <summary>
        /// Called by the framework to let <see cref="IMouseButtonHandler"/> perform any necessary cleanup
        /// when capture is going to be forcibly released.
        /// </summary>
        /// <remarks>
        /// <para>
        /// The <see cref="ControlGraphic"/> implementation calls <see cref="IMouseButtonHandler.Cancel"/> on
        /// the current handler or <see cref="Cancel"/> in decreasing order of priority.
        /// </para>
        /// </remarks>
        void IMouseButtonHandler.Cancel()
        {
            if (_capturedHandler != null)
            {
                _capturedHandler.Cancel();
                _capturedHandler = null;
            }

            try
            {
                this.Cancel();
            }
            finally
            {
                _isTracking          = false;
                _lastTrackedPosition = PointF.Empty;
            }
        }