Esempio n. 1
0
 void Initialize(IFactory <I> itemFactory)
 {
     Validate.ArgumentNotNull(parameter: itemFactory, parameterName: nameof(itemFactory));
     this._itemFactory      = itemFactory;
     this._selectionPattern = new SelectionImplementation <I>(uiObject: this, itemFactory: itemFactory);
     this._scrollPattern    = new ScrollImplementation(uiObject: this);
 }
Esempio n. 2
0
        public ScrollChangedEventWaiter(IScroll root, ScrollProperty scrollProperty, double expectedValue)
            : base(new PropertyChangedEventSource(root as UIObject, Scope.Element, UIProperty.Get("Scroll." + scrollProperty.ToString())))
        {
            Log.Comment("ScrollChangedEventWaiter - Constructor for scrollProperty={0} and expectedValue={1}.",
                        scrollProperty.ToString(), expectedValue.ToString());

            this.root                = root as UIObject;
            this.scrollProperty      = scrollProperty;
            this.expectedDoubleValue = expectedValue;

            if (!double.IsNaN(this.expectedDoubleValue))
            {
                switch (this.scrollProperty)
                {
                case ScrollProperty.HorizontalScrollPercent:
                    this.AddFilter(new Predicate <WaiterEventArgs>(args => root.HorizontalScrollPercent == expectedValue));
                    break;

                case ScrollProperty.HorizontalViewSize:
                    this.AddFilter(new Predicate <WaiterEventArgs>(args => root.HorizontalViewSize == expectedValue));
                    break;

                case ScrollProperty.VerticalScrollPercent:
                    this.AddFilter(new Predicate <WaiterEventArgs>(args => root.VerticalScrollPercent == expectedValue));
                    break;

                case ScrollProperty.VerticalViewSize:
                    this.AddFilter(new Predicate <WaiterEventArgs>(args => root.VerticalViewSize == expectedValue));
                    break;
                }
            }
            this.Reset();
        }
Esempio n. 3
0
        public ScrollableRenderTarget(Game game, int width, int height, IScrollable scrollable, IScroll scroll)
            : base(game)
        {
            _Width      = width;
            _Height     = height;
            _scrollable = scrollable;
            _scroll     = scroll;
            if (_scroll != null)
            {
                _scroll.ScrollContainer = this;
            }
            Scale   = 1;
            Alpha   = 1;
            Color   = Color.White;
            Culling = true;
#if SILVERLIGHT
            BackgroundColor = Color.TransparentWhite;
#else
            BackgroundColor = Color.Transparent;
#endif

            PosDif         = 0;
            MatrixInternal = Matrix.Identity;
            Matrix         = Matrix.Identity;
        }
Esempio n. 4
0
 public Scroll(IScroll @base)
     : this((IUIElement)@base)
 {
     ColumnHeader      = @base?.ColumnHeader;
     Clipper           = @base?.Clipper;
     ScrollHandleBound = @base?.ScrollHandleBound;
     ScrollHandle      = @base?.ScrollHandle;
 }
Esempio n. 5
0
		public Scroll(IScroll @base)
			:
			this((IUIElement)@base)
		{
			ColumnHeader = @base?.ColumnHeader;
			Clipper = @base?.Clipper;
			ScrollHandleBound = @base?.ScrollHandleBound;
			ScrollHandle = @base?.ScrollHandle;
		}
 public Scroller(IScroll owner)
 {
     _owner = owner;
     if (_owner.Style.ScrollerStyle == null)
     {
         throw new NotSupportedException("Scrolling controls require a Scroller Style.");
     }
     _style = _owner.Style.ScrollerStyle;
 }
Esempio n. 7
0
        public void ScrollDown()
        {
            IScroll atb = fm.CurrentControl as IScroll;

            if (atb != null && ((Control)atb).Focused)
            {
                atb.ScrollDown();
            }
        }
Esempio n. 8
0
 void Initialize(IFactory <I> itemFactory)
 {
     Validate.ArgumentNotNull(parameter: itemFactory, parameterName: nameof(itemFactory));
     this._itemFactory         = itemFactory;
     this._multipleViewPattern = new MultipleViewImplementation(uiObject: this);
     this._selectionPattern    = new SelectionImplementation <I>(uiObject: this, itemFactory: itemFactory);
     this._tablePattern        = new TableImplementation <I>(uiObject: this, itemFactory: itemFactory);
     this._itemContainPattern  = new ItemContainerImplementation(uiObject: this);
     this._scrollPattern       = new ScrollImplementation(uiObject: this);
 }
Esempio n. 9
0
        static public BotEngine.EveOnline.Interface.MemoryStruct.Scroll AsOld(this IScroll scroll)
        {
            if (scroll == null)
            {
                return(null);
            }

            return(new BotEngine.EveOnline.Interface.MemoryStruct.Scroll(scroll.AsOldUIElement())
            {
                Clipper = scroll?.Clipper?.AsOldUIElement(),
                ScrollHandleBound = scroll?.ScrollHandleBound?.AsOldUIElement(),
                ScrollHandle = scroll?.ScrollHandle?.AsOldUIElement(),
            });
        }
Esempio n. 10
0
        public ScrollChangedEventWaiter(IScroll root, ScrollProperty scrollProperty, bool?expectedValue)
            : base(new PropertyChangedEventSource(root as UIObject, Scope.Element, UIProperty.Get("Scroll." + scrollProperty.ToString())))
        {
            Log.Comment("ScrollChangedEventWaiter - Constructor for scrollProperty={0} and expectedValue={1}.",
                        scrollProperty.ToString(), expectedValue == null ? "null" : expectedValue.ToString());

            this.root              = root as UIObject;
            this.scrollProperty    = scrollProperty;
            this.expectedBoolValue = expectedValue;

            if (this.expectedBoolValue != null)
            {
                switch (this.scrollProperty)
                {
                case ScrollProperty.HorizontallyScrollable:
                    this.AddFilter(new Predicate <WaiterEventArgs>(args => root.HorizontallyScrollable == expectedValue));
                    break;

                case ScrollProperty.VerticallyScrollable:
                    this.AddFilter(new Predicate <WaiterEventArgs>(args => root.VerticallyScrollable == expectedValue));
                    break;
                }
            }
        }
 public static bool IsScrollable(this IScroll scroll)
 {
     return(scroll?.ScrollHandle?.Region.Height() < scroll?.ScrollHandleBound?.Region.Height() - 4);
 }