コード例 #1
0
            public ConstArg(
                Vector2 relativeCursorLength,
                ScrollerAxis scrollerAxis,
                Vector2 rubberBandLimitMultiplier,
                Vector2 relativeCursorPosition,
                bool isEnabledInertia,
                float inertiaDecay,
                float newScrollSpeedThreshold,

                IGenericSingleElementScrollerAdaptor adaptor,
                ActivationMode activationMode

                ) : base(
                    relativeCursorLength,
                    scrollerAxis,
                    relativeCursorPosition,
                    rubberBandLimitMultiplier,
                    isEnabledInertia,
                    inertiaDecay,
                    newScrollSpeedThreshold,

                    adaptor,
                    activationMode
                    )
            {
            }
コード例 #2
0
        public GenericSingleElementScrollerConstArg(
            Vector2 relativeCursorLength,
            ScrollerAxis scrollerAxis,
            Vector2 rubberBandLimitMultiplier,
            Vector2 relativeCursorPosition,
            bool isEnabledInertia,
            float newScrollSpeedThreshold,

            IUIManager uim,
            IUISystemProcessFactory processFactory,
            IUIElementFactory uieFactory,
            IGenericSingleElementScrollerAdaptor uia,
            IUIImage image,
            ActivationMode activationMode

            ) : base(
                scrollerAxis,
                relativeCursorPosition,
                rubberBandLimitMultiplier,
                isEnabledInertia,
                newScrollSpeedThreshold,

                uim,
                processFactory,
                uieFactory,
                uia,
                image,
                activationMode
                )
        {
            thisRelativeCursorLength = relativeCursorLength;
        }
コード例 #3
0
    TestGenericSingleElementScroller CreateGenericSingleElementScroller(Vector2 relativeCursorLength)
    {
        ScrollerAxis            scrollerAxis = ScrollerAxis.Both;
        Vector2                 rubberBandLimitMultiplier = new Vector2(.1f, .1f);
        Vector2                 relativeCursorPosition    = new Vector2(.5f, .5f);
        IUIManager              uim              = Substitute.For <IUIManager>();
        IUISystemProcessFactory processFactory   = Substitute.For <IUISystemProcessFactory>();
        IUIElementFactory       uieFactory       = Substitute.For <IUIElementFactory>();
        IGenericSingleElementScrollerAdaptor uia = Substitute.For <IGenericSingleElementScrollerAdaptor>();
        Rect scrollerRect = new Rect(Vector2.zero, new Vector2(200f, 100f));

        uia.GetRect().Returns(scrollerRect);
        IUIElement child       = Substitute.For <IUIElement>();
        IUIAdaptor childUIA    = Substitute.For <IUIAdaptor>();
        Rect       elementRect = new Rect(Vector2.zero, new Vector2(100f, 100f));

        childUIA.GetRect().Returns(elementRect);
        child.GetUIAdaptor().Returns(childUIA);
        List <IUIElement> returnedList = new List <IUIElement>(new IUIElement[] { child });

        uia.GetChildUIEs().Returns(returnedList);
        IUIImage image = Substitute.For <IUIImage>();
        float    newScrollSpeedThreshold = 200f;

        IGenericSingleElementScrollerConstArg arg = new GenericSingleElementScrollerConstArg(
            relativeCursorLength,
            scrollerAxis,
            rubberBandLimitMultiplier,
            relativeCursorPosition,
            true,
            newScrollSpeedThreshold,

            uim,
            processFactory,
            uieFactory,
            uia,
            image,
            ActivationMode.None
            );

        return(new TestGenericSingleElementScroller(arg));
    }
コード例 #4
0
    IGenericSingleElementScrollerConstArg CreateMockConstArg()
    {
        IGenericSingleElementScrollerConstArg arg = Substitute.For <IGenericSingleElementScrollerConstArg>();

        arg.relativeCursorLength.Returns(new Vector2(.5f, .5f));
        arg.scrollerAxis.Returns(ScrollerAxis.Both);
        arg.rubberBandLimitMultiplier.Returns(new Vector2(.1f, .1f));
        arg.relativeCursorPosition.Returns(new Vector2(0f, 0f));
        arg.isEnabledInertia.Returns(true);
        arg.uim.Returns(Substitute.For <IUIManager>());
        arg.processFactory.Returns(Substitute.For <IUISystemProcessFactory>());
        arg.uiElementFactory.Returns(Substitute.For <IUIElementFactory>());
        IGenericSingleElementScrollerAdaptor uia = Substitute.For <IGenericSingleElementScrollerAdaptor>();

        uia.GetRect().Returns(new Rect(Vector2.zero, new Vector2(200f, 100f)));
        uia.GetChildUIEs().Returns(new List <IUIElement>(new IUIElement[] { Substitute.For <IUIElement>() }));
        IUIAdaptor childAdaptor = Substitute.For <IUIAdaptor>();

        childAdaptor.GetRect().Returns(new Rect(Vector2.zero, new Vector2(100f, 100f)));
        uia.GetChildUIEs()[0].GetUIAdaptor().Returns(childAdaptor);
        arg.uia.Returns(uia);
        arg.image.Returns(Substitute.For <IUIImage>());
        return(arg);
    }