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); }
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); }