Пример #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);
     }
 }
Пример #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);
     }
 }
Пример #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);
        }