GetHitInfo() 공개 메소드

public GetHitInfo ( int index ) : SvgHitInfo
index int
리턴 SvgHitInfo
예제 #1
0
        static void SetEventOrigin(UIEventArgs e, SvgHitChain hitChain)
        {
            int count = hitChain.Count;

            if (count > 0)
            {
                var hitInfo = hitChain.GetHitInfo(count - 1);
                e.ExactHitObject = hitInfo;
            }
        }
예제 #2
0
        static void ForEachSvgElementBubbleUp(UIEventArgs e, SvgHitChain hitChain, EventListenerAction listenerAction)
        {
            for (int i = hitChain.Count - 1; i >= 0; --i)
            {
                //propagate up
                var hitInfo = hitChain.GetHitInfo(i);
                //---------------------
                //hit on element

                e.SetLocation((int)hitInfo.x, (int)hitInfo.y);
                if (listenerAction())
                {
                    return;
                }
            }
        }
예제 #3
0
        static void ForEachEventListenerBubbleUp(UIEventArgs e, SvgHitChain hitChain, EventListenerAction listenerAction)
        {
            for (int i = hitChain.Count - 1; i >= 0; --i)
            {
                //propagate up
                var            hitInfo    = hitChain.GetHitInfo(i);
                IEventListener controller = SvgElement.UnsafeGetController(hitInfo.svg) as IEventListener;
                //switch (hitInfo.hitObjectKind)
                //{
                //    default:
                //        {
                //            continue;
                //        }
                //    case HitObjectKind.Run:
                //        {
                //            CssRun run = (CssRun)hitInfo.hitObject;
                //            controller = CssBox.UnsafeGetController(run.OwnerBox) as IEventListener;

                //        } break;
                //    case HitObjectKind.CssBox:
                //        {
                //            CssBox box = (CssBox)hitInfo.hitObject;
                //            controller = CssBox.UnsafeGetController(box) as IEventListener;
                //        } break;
                //}

                //---------------------
                if (controller != null)
                {
                    //found controller

                    e.CurrentContextElement = controller;
                    e.SetLocation((int)hitInfo.x, (int)hitInfo.y);
                    if (listenerAction())
                    {
                        return;
                    }
                }
            }
        }
예제 #4
0
 static void ForEachOnlyEventPortalBubbleUp(UIEventArgs e, SvgHitChain hitPointChain, EventPortalAction eventPortalAction)
 {
     //only listener that need tunnel down
     for (int i = hitPointChain.Count - 1; i >= 0; --i)
     {
         //propagate up
         var        hitInfo = hitPointChain.GetHitInfo(i);
         SvgElement svg     = hitInfo.svg;
         if (svg != null)
         {
             var controller = SvgElement.UnsafeGetController(hitInfo.svg) as IEventPortal;
             if (controller != null)
             {
                 e.SetLocation((int)hitInfo.x, (int)hitInfo.y);
                 if (eventPortalAction(controller))
                 {
                     return;
                 }
             }
         }
     }
 }
예제 #5
0
 static void ForEachOnlyEventPortalBubbleUp(UIEventArgs e, SvgHitChain hitPointChain, EventPortalAction eventPortalAction)
 {
     //only listener that need tunnel down 
     for (int i = hitPointChain.Count - 1; i >= 0; --i)
     {
         //propagate up 
         var hitInfo = hitPointChain.GetHitInfo(i);
         SvgElement svg = hitInfo.svg;
         if (svg != null)
         {
             var controller = SvgElement.UnsafeGetController(hitInfo.svg) as IEventPortal;
             if (controller != null)
             {
                 e.SetLocation((int)hitInfo.x, (int)hitInfo.y);
                 if (eventPortalAction(controller))
                 {
                     return;
                 }
             }
         }
     }
 }
예제 #6
0
        static void ForEachEventListenerBubbleUp(UIEventArgs e, SvgHitChain hitChain, EventListenerAction listenerAction)
        {
            for (int i = hitChain.Count - 1; i >= 0; --i)
            {
                //propagate up 
                var hitInfo = hitChain.GetHitInfo(i);
                IEventListener controller = SvgElement.UnsafeGetController(hitInfo.svg) as IEventListener;
                //switch (hitInfo.hitObjectKind)
                //{
                //    default:
                //        {
                //            continue;
                //        }
                //    case HitObjectKind.Run:
                //        {
                //            CssRun run = (CssRun)hitInfo.hitObject;
                //            controller = CssBox.UnsafeGetController(run.OwnerBox) as IEventListener;

                //        } break;
                //    case HitObjectKind.CssBox:
                //        {
                //            CssBox box = (CssBox)hitInfo.hitObject;
                //            controller = CssBox.UnsafeGetController(box) as IEventListener;
                //        } break;
                //}

                //---------------------
                if (controller != null)
                {
                    //found controller

                    e.CurrentContextElement = controller;
                    e.SetLocation((int)hitInfo.x, (int)hitInfo.y);
                    if (listenerAction())
                    {
                        return;
                    }
                }
            }
        }
예제 #7
0
 static void SetEventOrigin(UIEventArgs e, SvgHitChain hitChain)
 {
     int count = hitChain.Count;
     if (count > 0)
     {
         var hitInfo = hitChain.GetHitInfo(count - 1);
         e.ExactHitObject = hitInfo;
     }
 }
예제 #8
0
        static void ForEachSvgElementBubbleUp(UIEventArgs e, SvgHitChain hitChain, EventListenerAction listenerAction)
        {
            for (int i = hitChain.Count - 1; i >= 0; --i)
            {
                //propagate up 
                var hitInfo = hitChain.GetHitInfo(i);
                //---------------------
                //hit on element  

                e.SetLocation((int)hitInfo.x, (int)hitInfo.y);
                if (listenerAction())
                {
                    return;
                }
            }
        }