Esempio n. 1
0
        protected int GetBucketCount()
        {
            if (!IsRuleFieldDefined)
            {
                return(m_coreSpatialElementManager.GetSpatialElementCount());
            }
            MapRuleDistributionType distributionType = GetDistributionType();
            ReportIntProperty       bucketCount      = m_mapRule.BucketCount;
            int num = m_defaultBucketCount;

            if (bucketCount != null)
            {
                num = (bucketCount.IsExpression ? m_mapRule.Instance.BucketCount : bucketCount.Value);
            }
            if (!IsRuleFieldScalar)
            {
                return(m_coreSpatialElementManager.GetDistinctValuesCount(m_coreRule.Field));
            }
            switch (distributionType)
            {
            case MapRuleDistributionType.Optimal:
            case MapRuleDistributionType.EqualDistribution:
                return(Math.Min(num, m_coreSpatialElementManager.GetDistinctValuesCount(m_coreRule.Field)));

            case MapRuleDistributionType.Custom:
                return((m_mapRule.MapBuckets ?? throw new RenderingObjectModelException(RPRes.rsMapLayerMissingProperty(RPRes.rsObjectTypeMap, m_mapRule.MapDef.Name, m_mapVectorLayer.Name, "MapBuckets"))).Count);

            default:
                return(num);
            }
        }