Beispiel #1
0
 /// <summary>
 /// Initiate a hit test using delegates.
 /// </summary>
 public static void HitTest(
     Visual reference,
     HitTestFilterCallback filterCallback,
     HitTestResultCallback resultCallback,
     HitTestParameters hitTestParameters)
 {
     CheckVisualReferenceArgument(reference);
     reference.HitTest(filterCallback, resultCallback, hitTestParameters);
 }
Beispiel #2
0
 /// <summary>
 /// Re-exposes the Visual base class's corresponding VisualTreeHelper implementation as public method.
 /// </summary>
 new public void HitTest(HitTestFilterCallback filterCallback, HitTestResultCallback resultCallback, HitTestParameters hitTestParameters)
 {
     base.HitTest(filterCallback, resultCallback, hitTestParameters);
 }
 public void HitTest(HitTestFilterCallback filterCallback, HitTestResultCallback resultCallback, HitTestParameters hitTestParameters)
 {
 }
Beispiel #4
0
        /// <summary>
        /// Initiate a hit test using delegates.
        /// </summary>
        internal void HitTest(
            HitTestFilterCallback filterCallback,
            HitTestResultCallback resultCallback,
            HitTestParameters hitTestParameters)
        {
            if (resultCallback == null)
            {
                throw new ArgumentNullException("resultCallback");
            }

            if (hitTestParameters == null)
            {
                throw new ArgumentNullException("hitTestParameters");
            }

            VerifyAPIReadWrite();

            Precompute();

            PointHitTestParameters pointParams = hitTestParameters as PointHitTestParameters;

            if (pointParams != null)
            {
                // Because we call dynamic code during the hit testing walk we need to back up
                // the original hit point in case the user's delegate throws an exception so that
                // we can restore it.
                Point backupHitPoint = pointParams.HitPoint;

                try
                {
                    HitTestPoint(filterCallback, resultCallback, pointParams);
                }
                catch
                {
                    // If an exception occured, restore the user's hit point and rethrow.
                    pointParams.SetHitPoint(backupHitPoint);

                    throw;
                }
                finally
                {
                    Debug.Assert(Point.Equals(pointParams.HitPoint, backupHitPoint),
                        "Failed to restore user's hit point back to the original coordinate system.");
                }
            }
            else
            {
                GeometryHitTestParameters geometryParams = hitTestParameters as GeometryHitTestParameters;

                if (geometryParams != null)
                {
                    // Because we call dynamic code during the hit testing walk we need to ensure
                    // that if the user's delegate throws an exception we restore the original
                    // transform on the hit test geometry.
#if DEBUG
                    // Internally we replace the hit geometry with a copy which is guaranteed to have
                    // a MatrixTransform so we do not need to worry about null dereferences here.
                    Matrix originalMatrix = geometryParams.InternalHitGeometry.Transform.Value;
#endif // DEBUG
                    try
                    {
                        HitTestGeometry(filterCallback, resultCallback, geometryParams);
                    }
                    catch
                    {
                        geometryParams.EmergencyRestoreOriginalTransform();

                        throw;
                    }
#if DEBUG
                    finally
                    {
                        Debug.Assert(Matrix.Equals(geometryParams.InternalHitGeometry.Transform.Value, originalMatrix),
                            "Failed to restore user's hit geometry back to the original coordinate system.");
                    }
#endif // DEBUG
                }
                else
                {
                    // This should never happen, users can not extend the abstract HitTestParameters class.
                    Invariant.Assert(false,
                        String.Format(System.Globalization.CultureInfo.InvariantCulture,
                            "'{0}' HitTestParameters are not supported on {1}.",
                            hitTestParameters.GetType().Name, this.GetType().Name));
                }
            }
        }
		public static void HitTest (Visual visual, HitTestFilterCallback filter, HitTestResultCallback results, HitTestParameters parameters)
		{
			throw new NotImplementedException ();
		}
Beispiel #6
0
 /// <summary>
 /// Re-exposes the Visual base class's corresponding VisualTreeHelper implementation as public method.
 /// </summary>
 new public void HitTest(HitTestFilterCallback filterCallback, HitTestResultCallback resultCallback, HitTestParameters hitTestParameters)
 {
     base.HitTest(filterCallback, resultCallback, hitTestParameters);
 }
Beispiel #7
0
 public static void HitTest(Visual visual, HitTestFilterCallback filter, HitTestResultCallback results, HitTestParameters parameters)
 {
     throw new NotImplementedException();
 }
 /// <summary>
 /// Initiate a hit test using delegates.
 /// </summary>
 public static void HitTest(
     Visual reference,
     HitTestFilterCallback filterCallback,
     HitTestResultCallback resultCallback,
     HitTestParameters hitTestParameters)
 {
     CheckVisualReferenceArgument(reference);
     reference.HitTest(filterCallback, resultCallback, hitTestParameters);
 }
Beispiel #9
0
 public static void HitTest(Visual reference, HitTestFilterCallback filterCallback, HitTestResultCallback resultCallback, HitTestParameters hitTestParameters)
 {
     Contract.Requires(reference != null);
     Contract.Requires(resultCallback != null);
     Contract.Requires(hitTestParameters != null);
 }
 public void HitTest(HitTestFilterCallback filterCallback, HitTestResultCallback resultCallback, HitTestParameters hitTestParameters)
 {
 }
    public static void HitTest(Visual reference, HitTestFilterCallback filterCallback, HitTestResultCallback resultCallback, HitTestParameters hitTestParameters)
    {
      Contract.Requires(reference != null);

    }