Пример #1
0
        private static void SetDrawingLevelForStyle(Style style)
        {
            AreaStyle       areaStyle       = style as AreaStyle;
            LineStyle       lineStyle       = style as LineStyle;
            PointStyle      pointStyle      = style as PointStyle;
            CompositeStyle  compositeStyle  = style as CompositeStyle;
            FilterStyle     filterStyle     = style as FilterStyle;
            ValueStyle      valueStyle      = style as ValueStyle;
            ClassBreakStyle classBreakStyle = style as ClassBreakStyle;

            if (areaStyle != null)
            {
                areaStyle.SetDrawingLevel();
            }
            else if (lineStyle != null)
            {
                lineStyle.SetDrawingLevel();
            }
            else if (pointStyle != null)
            {
                pointStyle.SetDrawingLevel();
            }
            else if (filterStyle != null)
            {
                foreach (var item in filterStyle.Styles)
                {
                    SetDrawingLevelForStyle(item);
                }
            }
            else if (classBreakStyle != null)
            {
                foreach (var item in classBreakStyle.ClassBreaks.SelectMany(v => v.CustomStyles))
                {
                    SetDrawingLevelForStyle(item);
                }
            }
            else if (valueStyle != null)
            {
                foreach (var item in valueStyle.ValueItems.SelectMany(v => v.CustomStyles))
                {
                    SetDrawingLevelForStyle(item);
                }
            }
            else if (compositeStyle != null)
            {
                foreach (var subStyle in compositeStyle.Styles)
                {
                    SetDrawingLevelForStyle(subStyle);
                }
            }
        }