コード例 #1
0
        private static themeQuantity GetThemeQuantity(QuantityTheme theme)
        {
            // QuantityTheme properties
            var quanThemeItems = new List <themeItem>();

            foreach (QuantityThemeItem item in theme.ThemeItems)
            {
                // Add theme items (style and label) to the QuantityTheme
                // NOTE: The actual Category of this specific ThemeItem is always equal to the Label (no need to store it twice)
                // NOTE: Symbol isn't stored but generated during rebuilding in the QuantityThemeItem.AddStyle() method
                var quanThemeItem = new themeItem
                {
                    label            = item.Label,
                    style            = GetStyleConverter().ConvertToString(item.Style),
                    intervalMinValue = item.Interval.Min,
                    intervalMaxValue = item.Interval.Max
                };

                quanThemeItems.Add(quanThemeItem);
            }

            var themeQuantity = new themeQuantity
            {
                columnName         = theme.AttributeName,
                defaultStyle       = GetDefaultStyle(theme),
                noDataValues       = GetNoDataValues(theme.NoDataValues),
                noDataValueType    = GetNoDataValueType(theme.NoDataValues),
                quantityThemeItems = quanThemeItems.ToArray()
            };

            return(themeQuantity);
        }
コード例 #2
0
        private static themeQuantity GetThemeQuantity(QuantityTheme theme)
        {
            // QuantityTheme properties
            var quanThemeItems = new List<themeItem>();

            foreach (QuantityThemeItem item in theme.ThemeItems)
            {
                // Add theme items (style and label) to the QuantityTheme
                // NOTE: The actual Category of this specific ThemeItem is always equal to the Label (no need to store it twice)
                // NOTE: Symbol isn't stored but generated during rebuilding in the QuantityThemeItem.AddStyle() method
                var quanThemeItem = new themeItem
                                        {
                                            label = item.Label,
                                            style = GetStyleConverter().ConvertToString(item.Style),
                                            intervalMinValue = item.Interval.Min,
                                            intervalMaxValue = item.Interval.Max
                                        };

                quanThemeItems.Add(quanThemeItem);
            }

            var themeQuantity = new themeQuantity
                                    {
                                        columnName = theme.AttributeName,
                                        defaultStyle = GetDefaultStyle(theme),
                                        noDataValues = GetNoDataValues(theme.NoDataValues),
                                        noDataValueType = GetNoDataValueType(theme.NoDataValues),
                                        quantityThemeItems = quanThemeItems.ToArray()
                                    };

            return themeQuantity;
        }