Пример #1
0
        public override object Clone()
        {
            var gradientTheme = new GradientTheme
            {
                AttributeName   = AttributeName,
                minValue        = minValue,
                maxValue        = maxValue,
                fillColorBlend  = (null != FillColorBlend) ? (ColorBlend)FillColorBlend.Clone() : null,
                lineColorBlend  = (null != LineColorBlend) ? (ColorBlend)LineColorBlend.Clone() : null,
                textColorBlend  = (null != TextColorBlend) ? (ColorBlend)TextColorBlend.Clone() : null,
                numberOfClasses = numberOfClasses,
                minColor        = minColor,
                maxColor        = maxColor
            };

            gradientTheme.themeItems.AddRange(ThemeItems.Select(ti => (IThemeItem)((GradientThemeItem)ti).Clone()));
            gradientTheme.minItem = (GradientThemeItem)gradientTheme.themeItems.First();
            gradientTheme.maxItem = (GradientThemeItem)gradientTheme.themeItems.Last();

            if (NoDataValues != null)
            {
                gradientTheme.noDataValues = NoDataValues.Cast <object>().ToArray();
            }


            return(gradientTheme);
        }
Пример #2
0
        public override object Clone()
        {
            var quantityTheme = new QuantityTheme(AttributeName, defaultStyle);

            foreach (QuantityThemeItem quantityThemeItem in ThemeItems)
            {
                quantityTheme.ThemeItems.Add((QuantityThemeItem)quantityThemeItem.Clone());
            }

            if (NoDataValues != null)
            {
                quantityTheme.NoDataValues = NoDataValues.Cast <object>().ToArray();
            }

            return(quantityTheme);
        }
        public override object Clone()
        {
            var categorialTheme = new CategorialTheme(AttributeName, (IStyle)defaultStyle.Clone());

            foreach (CategorialThemeItem categorialThemeItem in ThemeItems)
            {
                categorialTheme.ThemeItems.Add((CategorialThemeItem)categorialThemeItem.Clone());
            }

            if (NoDataValues != null)
            {
                categorialTheme.NoDataValues = NoDataValues.Cast <object>().ToArray();
            }

            return(categorialTheme);
        }
Пример #4
0
        private IEnumerable <IComparable> GetValuesExceptNoData(IEnumerable <IComparable> values)
        {
            if (NoDataValues == null)
            {
                return(values);
            }

            var noDataValues = NoDataValues.Cast <IComparable>().ToArray();

            if (noDataValues.Length == 1)
            {
                return(values.Where(v2 => !Equals(v2, noDataValues[0])));
            }

            if (noDataValues.Length > 1)
            {
                throw new NotSupportedException("Multiple NODATA value are not supported");
            }

            return(values);
        }
Пример #5
0
        public override object Clone()
        {
            var gradientTheme = new GradientTheme(attributeName, minValue, maxValue, (IStyle)MinStyle.Clone(),
                                                  (IStyle)MaxStyle.Clone(),
                                                  (null != FillColorBlend) ? (ColorBlend)FillColorBlend.Clone() : null,
                                                  (null != LineColorBlend) ? (ColorBlend)LineColorBlend.Clone() : null,
                                                  (null != TextColorBlend) ? (ColorBlend)TextColorBlend.Clone() : null, numberOfClasses);

            gradientTheme.ThemeItems.Clear();

            foreach (var themeItem in ThemeItems)
            {
                gradientTheme.ThemeItems.Add((IThemeItem)((GradientThemeItem)themeItem).Clone());
            }

            if (NoDataValues != null)
            {
                gradientTheme.NoDataValues = NoDataValues.Cast <object>().ToArray();
            }

            return(gradientTheme);
        }