Exemple #1
0
        private void SetCurrentIndexElementClipArea(
            int currentIndex,
            RatingElementType elementType,
            RatingVisualElement element)
        {
            switch (elementType)
            {
            case RatingElementType.Hover:
                Point relativePoint1 = this.GetRelativePoint(currentIndex, (RatingBaseVisualElement)element.HoverElement, new double?(this.HoverValue));
                element.HoverElement.ClipArea = this.GetCurrentElementClipArea((RatingBaseVisualElement)element.HoverElement, relativePoint1);
                break;

            case RatingElementType.Value:
                Point relativePoint2 = this.GetRelativePoint(currentIndex, (RatingBaseVisualElement)element.ValueElement, this.Value);
                element.ValueElement.ClipArea = this.GetCurrentElementClipArea((RatingBaseVisualElement)element.ValueElement, relativePoint2);
                break;

            case RatingElementType.SelectedValue:
                Point relativePoint3 = this.GetRelativePoint(currentIndex, (RatingBaseVisualElement)element.SelectedValueElement, new double?(this.SelectedValue));
                element.SelectedValueElement.ClipArea = this.GetCurrentElementClipArea((RatingBaseVisualElement)element.SelectedValueElement, relativePoint3);
                break;

            default:
                throw new InvalidEnumArgumentException();
            }
        }
Exemple #2
0
        private void PaintLayer(int currentIndex, RatingElementType elementType)
        {
            int num = 0;

            if (this.RightToLeft && this.ElementOrientation == Orientation.Horizontal)
            {
                for (int index = this.items.Count - 1; index >= 0; --index)
                {
                    RatingVisualElement element = this.items[index] as RatingVisualElement;
                    if (num < currentIndex)
                    {
                        this.SetLowerIndexElementsClipArea(elementType, element);
                    }
                    else if (num == currentIndex)
                    {
                        this.SetCurrentIndexElementClipArea(currentIndex, elementType, element);
                    }
                    else
                    {
                        this.SetHigherIndexElementsClipArea(elementType, element);
                    }
                    ++num;
                    element.Invalidate();
                }
            }
            else
            {
                foreach (RatingVisualElement element in (RadItemCollection)this.Items)
                {
                    if (element.BoundingRectangle.X + element.BoundingRectangle.Width > this.ElementsLayout.BoundingRectangle.Width || this.ElementsLayout.BoundingRectangle.Width < element.MinSize.Width || this.ElementsLayout.BoundingRectangle.Height < element.BoundingRectangle.Height + element.BoundingRectangle.Y)
                    {
                        element.Visibility = ElementVisibility.Hidden;
                    }
                    else
                    {
                        element.Visibility = ElementVisibility.Visible;
                        if (num < currentIndex)
                        {
                            this.SetLowerIndexElementsClipArea(elementType, element);
                        }
                        else if (num == currentIndex)
                        {
                            this.SetCurrentIndexElementClipArea(currentIndex, elementType, element);
                        }
                        else
                        {
                            this.SetHigherIndexElementsClipArea(elementType, element);
                        }
                        ++num;
                        element.Invalidate();
                    }
                }
            }
        }
Exemple #3
0
        private void SetHigherIndexElementsClipArea(
            RatingElementType elementType,
            RatingVisualElement element)
        {
            switch (elementType)
            {
            case RatingElementType.Hover:
                element.HoverElement.ClipArea = this.GetElementClipArea((RatingBaseVisualElement)element.HoverElement, false);
                break;

            case RatingElementType.Value:
                element.ValueElement.ClipArea = this.GetElementClipArea((RatingBaseVisualElement)element.ValueElement, false);
                break;

            case RatingElementType.SelectedValue:
                element.SelectedValueElement.ClipArea = this.GetElementClipArea((RatingBaseVisualElement)element.SelectedValueElement, false);
                break;

            default:
                throw new InvalidEnumArgumentException();
            }
        }