Exemplo n.º 1
0
 private static HitTestFilterBehavior OnHitTestFilter(int callbacksId, IntPtr targetPtr)
 {
     try {
         HitTestCallbackInfo info = _hitTestCallbacks[callbacksId];
         return(info.Filter((Visual)Extend.GetProxy(targetPtr, false)));
     }
     catch (Exception e)
     {
         Noesis.Error.UnhandledException(e);
         return(HitTestFilterBehavior.Stop);
     }
 }
Exemplo n.º 2
0
 private static HitTestResultBehavior OnHitTestResult(int callbacksId, IntPtr hitPtr)
 {
     try {
         HitTestCallbackInfo info = _hitTestCallbacks[callbacksId];
         return(info.Result(new HitTestResult(hitPtr, false)));
     }
     catch (Exception e)
     {
         Noesis.Error.UnhandledException(e);
         return(HitTestResultBehavior.Stop);
     }
 }
Exemplo n.º 3
0
        public static void HitTest(Visual reference, HitTestFilterCallback filterCallback, HitTestResultCallback resultCallback, HitTestParameters hitTestParameters)
        {
            PointHitTestParameters pointParams = (PointHitTestParameters)hitTestParameters;
            HitTestCallbackInfo    info        = new HitTestCallbackInfo {
                Filter = filterCallback, Result = resultCallback
            };
            int callbacksId = info.GetHashCode();

            _hitTestCallbacks[callbacksId] = info;
            HitTestCallbackHelper(reference, pointParams.HitPoint, callbacksId, _hitTestFilter, _hitTestResult);
            _hitTestCallbacks.Remove(callbacksId);
        }