Esempio n. 1
0
        protected override void CreateChildElements()
        {
            base.CreateChildElements();

            separatorElement = new WaitingBarSeparatorElement();
            textElement      = new WaitingBarTextElement();
            indicators       = new WaitingIndicatorCollection();

            Indicators[0].SetDefaultValueOverride(RadElement.VisibilityProperty, ElementVisibility.Visible);
            Indicators[1].SetDefaultValueOverride(RadElement.VisibilityProperty, ElementVisibility.Collapsed);
            separatorElement.Class = "WaitingBarSeparator";

            this.Children.Add(separatorElement);
            this.Children.Add(textElement);
            this.Children.Add(Indicators[0]);
            this.Children.Add(Indicators[1]);
        }
Esempio n. 2
0
        protected void ArrangeIndeterminateIndicatorElements(WaitingIndicatorCollection indicators, RectangleF clientRect)
        {
            UpdateOffset(clientRect);
            float indicatorStep = CalculateIndicatorStep(clientRect);

            for (int i = 0; i < indicators.Count; i++)
            {
                RectangleF rect = MoveIndicatorElement(Indicators[i], clientRect, this.WaitingDirection);
                float      dx   = rect.X;
                float      dy   = rect.Y;

                if ((this.WaitingDirection == ProgressOrientation.Right && !this.RightToLeft) || (this.WaitingDirection == ProgressOrientation.Left && this.RightToLeft))
                {
                    dx += AddIndicatorStep(indicatorStep, i);
                    if (dx > clientRect.Width * 2 - indicators[0].DesiredSize.Width)
                    {
                        dx -= clientRect.Width * 2;
                    }
                    if (waitingFirstRun && i != 0 && dx > offset)
                    {
                        dx = -Indicators[0].DesiredSize.Width;
                    }
                }

                if (this.WaitingDirection == ProgressOrientation.Bottom)
                {
                    dy += AddIndicatorStep(indicatorStep, i);
                    if (dy > clientRect.Height * 2 - indicators[0].DesiredSize.Height)
                    {
                        dy -= clientRect.Height * 2;
                    }
                    if (waitingFirstRun && i != 0 && dy > offset)
                    {
                        dy = -Indicators[0].DesiredSize.Height;
                    }
                }

                if ((this.WaitingDirection == ProgressOrientation.Left && !this.RightToLeft) || (this.WaitingDirection == ProgressOrientation.Right && this.RightToLeft))
                {
                    dx -= AddIndicatorStep(indicatorStep, i);
                    if (dx < -clientRect.Width)
                    {
                        dx += clientRect.Width * 2;
                    }
                    if (waitingFirstRun && i != 0 && dx < clientRect.Width - indicators[0].DesiredSize.Width - offset)
                    {
                        dx = clientRect.Width;
                    }
                }

                if (this.WaitingDirection == ProgressOrientation.Top)
                {
                    dy -= AddIndicatorStep(indicatorStep, i);
                    if (dy < -clientRect.Height)
                    {
                        dy += clientRect.Height * 2;
                    }
                    if (waitingFirstRun && i != 0 && dy < clientRect.Height - indicators[0].DesiredSize.Height - offset)
                    {
                        dy = -Indicators[0].DesiredSize.Height;
                    }
                }

                indicators[i].Arrange(new RectangleF(new PointF(dx, dy), indicators[i].DesiredSize));
            }
        }