Esempio n. 1
0
        protected RectangleF MoveIndicatorElement(WaitingBarIndicatorElement element, RectangleF clientRect, ProgressOrientation waitingDirection)
        {
            float dx = clientRect.X;
            float dy = clientRect.Y;

            if ((waitingDirection == ProgressOrientation.Right && !this.RightToLeft) || (waitingDirection == ProgressOrientation.Left && this.RightToLeft))
            {
                dx += offset;
                dy += (clientRect.Height - element.DesiredSize.Height) / 2;
            }

            if ((waitingDirection == ProgressOrientation.Left && !this.RightToLeft) || (waitingDirection == ProgressOrientation.Right && this.RightToLeft))
            {
                dx += clientRect.Width - element.DesiredSize.Width - offset;
                dy += (clientRect.Height - element.DesiredSize.Height) / 2;
            }

            if (waitingDirection == ProgressOrientation.Top)
            {
                dy += clientRect.Height - element.DesiredSize.Height - offset;
                dx += (clientRect.Width - element.DesiredSize.Width) / 2;
            }

            if (waitingDirection == ProgressOrientation.Bottom)
            {
                dy += offset;
                dx += (clientRect.Width - element.DesiredSize.Width) / 2;
            }

            return(new RectangleF(new PointF(dx, dy), element.DesiredSize));
        }
Esempio n. 2
0
        protected RectangleF MoveIndicatorElement(
            WaitingBarIndicatorElement element,
            RectangleF clientRect,
            ProgressOrientation waitingDirection)
        {
            float x = clientRect.X;
            float y = clientRect.Y;

            if (waitingDirection == ProgressOrientation.Right && !this.RightToLeft || waitingDirection == ProgressOrientation.Left && this.RightToLeft)
            {
                x += this.offset;
                y += (float)(((double)clientRect.Height - (double)element.DesiredSize.Height) / 2.0);
            }
            if (waitingDirection == ProgressOrientation.Left && !this.RightToLeft || waitingDirection == ProgressOrientation.Right && this.RightToLeft)
            {
                x += clientRect.Width - element.DesiredSize.Width - this.offset;
                y += (float)(((double)clientRect.Height - (double)element.DesiredSize.Height) / 2.0);
            }
            if (waitingDirection == ProgressOrientation.Top)
            {
                y += clientRect.Height - element.DesiredSize.Height - this.offset;
                x += (float)(((double)clientRect.Width - (double)element.DesiredSize.Width) / 2.0);
            }
            if (waitingDirection == ProgressOrientation.Bottom)
            {
                y += this.offset;
                x += (float)(((double)clientRect.Width - (double)element.DesiredSize.Width) / 2.0);
            }
            return(new RectangleF(new PointF(x, y), element.DesiredSize));
        }
Esempio n. 3
0
        protected void UpdateElementsState(WaitingBarIndicatorElement indicator)
        {
            bool isVertical = IsVertical();

            indicator.SetValue(WaitingBarIndicatorElement.IsVerticalProperty, isVertical);
            indicator.SeparatorElement.SetValue(WaitingBarSeparatorElement.IsVerticalProperty, isVertical);
        }
Esempio n. 4
0
        protected void UpdateIndicatorStretch(WaitingBarIndicatorElement indicator)
        {
            bool isVertical = IsVertical();

            if (isVertical)
            {
                indicator.StretchHorizontally = true;
                indicator.StretchVertically   = false;
            }
            else
            {
                indicator.StretchHorizontally = false;
                indicator.StretchVertically   = true;
            }
        }
Esempio n. 5
0
        protected RectangleF GetThrobberIndicatorElementFinalSize(
            WaitingBarIndicatorElement element,
            RectangleF clientRect)
        {
            bool flag = this.IsVertical();

            if (!flag && (double)this.offset >= (double)clientRect.Width - (double)element.DesiredSize.Width || flag && (double)this.offset >= (double)clientRect.Height - (double)element.DesiredSize.Height)
            {
                this.offset      = 0.0f;
                this.isBackwards = !this.isBackwards;
            }
            if (!this.isBackwards)
            {
                return(this.MoveIndicatorElement(element, clientRect, this.WaitingDirection));
            }
            ProgressOrientation reversedDirection = this.GetReversedDirection(this.WaitingDirection);

            return(this.MoveIndicatorElement(element, clientRect, reversedDirection));
        }
Esempio n. 6
0
        protected RectangleF GetThrobberIndicatorElementFinalSize(WaitingBarIndicatorElement element, RectangleF clientRect)
        {
            bool isVertical = IsVertical();

            if ((!isVertical && offset >= clientRect.Width - element.DesiredSize.Width) || (isVertical && offset >= clientRect.Height - element.DesiredSize.Height))
            {
                offset      = 0;
                isBackwards = isBackwards ? false : true;
            }

            if (!isBackwards)
            {
                return(MoveIndicatorElement(element, clientRect, this.WaitingDirection));
            }
            else
            {
                ProgressOrientation reverseDirection = GetReversedDirection(this.WaitingDirection);
                return(MoveIndicatorElement(element, clientRect, reverseDirection));
            }
        }
Esempio n. 7
0
        protected virtual void UpdateElementsState(ProgressOrientation direction)
        {
            bool flag = false;

            if (direction == ProgressOrientation.Top || direction == ProgressOrientation.Bottom)
            {
                flag = true;
            }
            int num1 = (int)this.SetValue(RadWaitingBarElement.IsVerticalProperty, (object)flag);

            if (!this.ContentElement.IsOldWaitingStyle)
            {
                return;
            }
            int num2 = (int)this.SeparatorElement.SetValue(WaitingBarSeparatorElement.IsVerticalProperty, (object)flag);

            for (int index = 0; index < this.WaitingIndicators.Count; ++index)
            {
                WaitingBarIndicatorElement waitingIndicator = this.WaitingIndicators[index] as WaitingBarIndicatorElement;
                int num3 = (int)waitingIndicator.SetValue(WaitingBarIndicatorElement.IsVerticalProperty, (object)flag);
                int num4 = (int)waitingIndicator.SeparatorElement.SetValue(WaitingBarSeparatorElement.IsVerticalProperty, (object)flag);
            }
        }
Esempio n. 8
0
        void Indicators_CollectionChanged(object sender, NotifyCollectionChangedEventArgs e)
        {
            if (e.Action == NotifyCollectionChangedAction.Add)
            {
                IList list = e.NewItems;
                for (int i = 0; i < list.Count; i++)
                {
                    WaitingBarIndicatorElement indicator = (WaitingBarIndicatorElement)list[i];
                    this.Children.Add(indicator);
                    UpdateElementsState(indicator);
                    UpdateIndicatorStretch(indicator);
                }
            }

            if (e.Action == NotifyCollectionChangedAction.Remove)
            {
                IList list = e.NewItems;
                for (int i = 0; i < list.Count; i++)
                {
                    ((WaitingBarIndicatorElement)list[i]).Invalidate();
                    this.Children.Remove((WaitingBarIndicatorElement)list[i]);
                }
            }
        }
Esempio n. 9
0
 protected void UpdateElementsState(WaitingBarIndicatorElement indicator)
 {
     bool flag = this.IsVertical();
     int  num1 = (int)indicator.SetValue(WaitingBarIndicatorElement.IsVerticalProperty, (object)flag);
     int  num2 = (int)indicator.SeparatorElement.SetValue(WaitingBarSeparatorElement.IsVerticalProperty, (object)flag);
 }