Example #1
0
        private static themeGradient GetThemeGradient(GradientTheme theme)
        {
            // GradientTheme properties
            string minStyle = GetStyleConverter().ConvertToString(theme.MinStyle);
            string maxStyle = GetStyleConverter().ConvertToString(theme.MaxStyle);

            var gradThemeItems = new List <themeItem>();

            foreach (GradientThemeItem item in theme.ThemeItems)
            {
                // Add theme items (style and label) to the QuantityTheme
                // NOTE: Symbol isn't stored but generated during rebuilding in the QuantityThemeItem.AddStyle() method
                var gradThemeItem = new themeItem
                {
                    label            = item.Label,
                    style            = GetStyleConverter().ConvertToString(item.Style),
                    intervalMaxValue = Convert.ToDouble(item.Range)
                };

                gradThemeItems.Add(gradThemeItem);
            }

            var themeGradient = new themeGradient
            {
                gradientThemeItems = gradThemeItems.ToArray(),
                columnName         = theme.ColumnName,
                minValue           = theme.Min,
                maxValue           = theme.Max,
                minStyle           = minStyle,
                maxStyle           = maxStyle,
                noDataValues       = GetNoDataValues(theme.NoDataValues),
                noDataValueType    = GetNoDataValueType(theme.NoDataValues),

                // Color blends
                textColorBlends = (theme.TextColorBlend != null)
                                                ? CreateBlendsFromTheme(theme.TextColorBlend)
                                                : null,
                lineColorBlends = (theme.LineColorBlend != null)
                                                ? CreateBlendsFromTheme(theme.LineColorBlend)
                                                : null,
                fillColorBlends = (theme.FillColorBlend != null)
                                                ? CreateBlendsFromTheme(theme.FillColorBlend)
                                                : null
            };

            return(themeGradient);
        }
Example #2
0
        private static themeGradient GetThemeGradient(GradientTheme theme)
        {
            // GradientTheme properties
            string minStyle = GetStyleConverter().ConvertToString(theme.MinStyle);
            string maxStyle = GetStyleConverter().ConvertToString(theme.MaxStyle);
            
            var gradThemeItems = new List<themeItem>();
            foreach (GradientThemeItem item in theme.ThemeItems)
            {
                // Add theme items (style and label) to the QuantityTheme
                // NOTE: Symbol isn't stored but generated during rebuilding in the QuantityThemeItem.AddStyle() method
                var gradThemeItem = new themeItem
                                        {
                                            label = item.Label,
                                            style = GetStyleConverter().ConvertToString(item.Style),
                                            intervalMaxValue = Convert.ToDouble(item.Range)
                                        };

                gradThemeItems.Add(gradThemeItem);
            }

            var themeGradient = new themeGradient
                                    {
                                        gradientThemeItems = gradThemeItems.ToArray(),
                                        columnName = theme.ColumnName,
                                        minValue = theme.Min,
                                        maxValue = theme.Max,
                                        minStyle = minStyle,
                                        maxStyle = maxStyle,
                                        noDataValues = GetNoDataValues(theme.NoDataValues),
                                        noDataValueType = GetNoDataValueType(theme.NoDataValues),

                                        // Color blends
                                        textColorBlends = (theme.TextColorBlend != null)
                                                ? CreateBlendsFromTheme(theme.TextColorBlend)
                                                : null,
                                        lineColorBlends = (theme.LineColorBlend != null)
                                                ? CreateBlendsFromTheme(theme.LineColorBlend)
                                                : null,
                                        fillColorBlends = (theme.FillColorBlend != null)
                                                ? CreateBlendsFromTheme(theme.FillColorBlend)
                                                : null
                                    };
            return themeGradient;
        }