Example #1
0
 string GetScrollerProximateParentScrollerString()
 {
     if (thisUIM != null)
     {
         IScroller scrollerInMotion = thisUIM.GetInputHandlingScroller();
         if (scrollerInMotion != null)
         {
             IScroller proximateParentScroller = scrollerInMotion.GetProximateParentScroller();
             string    result = "par: ";
             if (proximateParentScroller != null)
             {
                 result += proximateParentScroller.GetUIAdaptor().GetName();
             }
             else
             {
                 result += "null";
             }
             return(result);
         }
         else
         {
             return("scroller: null");
         }
     }
     else
     {
         return("uim is not set");
     }
 }
        protected override IScroller FindProximateParentScroller()
        {
            IScroller parentScroller = Substitute.For <IScroller>();
            IScroller nullScroller   = null;

            parentScroller.GetProximateParentScroller().Returns(nullScroller);
            return(parentScroller);
        }
Example #3
0
        void ClearAllParentScrollerVelocity()
        {
            IScroller scrollerToExamine = GetTargetUIEOrItsProximateParentAsScroller(this);

            while (true)
            {
                if (scrollerToExamine == null)
                {
                    break;
                }
                for (int i = 0; i < 2; i++)
                {
                    scrollerToExamine.UpdateVelocity(0f, i);
                }
                scrollerToExamine = scrollerToExamine.GetProximateParentScroller();
            }
        }
Example #4
0
        /* Scroller Helper */
        public void CheckAndPerformStaticBoundarySnapFrom(IUIElement uieToStartCheck)
        {
            ClearTopMostScroller();
            IScroller scrollerToStartCheck = GetTargetUIEOrItsProximateParentAsScroller(uieToStartCheck);
            IScroller scrollerToExamine    = scrollerToStartCheck;

            while (true)
            {
                if (scrollerToExamine == null)
                {
                    break;
                }
                scrollerToExamine.ResetDrag();
                scrollerToExamine.CheckAndPerformStaticBoundarySnap();
                scrollerToExamine = scrollerToExamine.GetProximateParentScroller();
            }
        }