private void SetSymbolRuleMarkers(PredefinedSymbolCollection customSymbols)
        {
            int                 bucketCount   = base.GetBucketCount();
            MapMarkerRule       mapMarkerRule = (MapMarkerRule)base.m_mapRule;
            MapMarkerCollection mapMarkers    = mapMarkerRule.MapMarkers;
            int                 count         = mapMarkers.Count;
            MapBucketCollection mapBuckets    = base.m_mapRule.MapBuckets;
            bool                flag          = base.GetDistributionType() == MapRuleDistributionType.Custom;

            for (int i = 0; i < bucketCount; i++)
            {
                PredefinedSymbol predefinedSymbol = new PredefinedSymbol();
                if (i < count)
                {
                    this.RenderMarker(predefinedSymbol, ((ReportElementCollectionBase <MapMarker>)mapMarkers)[i]);
                }
                else
                {
                    predefinedSymbol.MarkerStyle = MarkerStyle.None;
                }
                if (flag)
                {
                    MapBucket bucket = ((ReportElementCollectionBase <MapBucket>)mapBuckets)[i];
                    predefinedSymbol.FromValue = base.GetFromValue(bucket);
                    predefinedSymbol.ToValue   = base.GetToValue(bucket);
                }
                customSymbols.Add(predefinedSymbol);
            }
        }
Example #2
0
        private void SetSymbolRuleSizes(PredefinedSymbolCollection customSymbols)
        {
            int bucketCount = base.GetBucketCount();

            if (bucketCount != 0)
            {
                double startSize = this.GetStartSize();
                double num       = (this.GetEndSize() - startSize) / (double)bucketCount;
                MapBucketCollection mapBuckets = base.m_mapRule.MapBuckets;
                bool flag = base.GetDistributionType() == MapRuleDistributionType.Custom;
                for (int i = 0; i < bucketCount; i++)
                {
                    PredefinedSymbol predefinedSymbol  = new PredefinedSymbol();
                    PredefinedSymbol predefinedSymbol2 = predefinedSymbol;
                    PredefinedSymbol predefinedSymbol3 = predefinedSymbol;
                    float            num4 = predefinedSymbol2.Width = (predefinedSymbol3.Height = (float)(int)Math.Round(startSize + (double)i * num));
                    if (flag)
                    {
                        MapBucket bucket = ((ReportElementCollectionBase <MapBucket>)mapBuckets)[i];
                        predefinedSymbol.FromValue = base.GetFromValue(bucket);
                        predefinedSymbol.ToValue   = base.GetToValue(bucket);
                    }
                    customSymbols.Add(predefinedSymbol);
                }
            }
        }
Example #3
0
        private void SetSymbolRuleColors(Color[] colorRange, PredefinedSymbolCollection customSymbols)
        {
            MapBucketCollection mapBuckets = base.m_mapRule.MapBuckets;
            bool flag        = base.GetDistributionType() == MapRuleDistributionType.Custom;
            int  bucketCount = base.GetBucketCount();

            for (int i = 0; i < bucketCount; i++)
            {
                PredefinedSymbol predefinedSymbol = new PredefinedSymbol();
                if (i < colorRange.Length)
                {
                    predefinedSymbol.Color = colorRange[i];
                }
                else
                {
                    predefinedSymbol.Color = Color.Empty;
                }
                if (flag)
                {
                    MapBucket bucket = ((ReportElementCollectionBase <MapBucket>)mapBuckets)[i];
                    predefinedSymbol.FromValue = base.GetFromValue(bucket);
                    predefinedSymbol.ToValue   = base.GetToValue(bucket);
                }
                customSymbols.Add(predefinedSymbol);
            }
        }
Example #4
0
        private void SetRuleColors(Color[] colorRange, CustomColorCollection customColors)
        {
            MapBucketCollection mapBuckets = base.m_mapRule.MapBuckets;
            bool flag        = base.GetDistributionType() == MapRuleDistributionType.Custom;
            int  bucketCount = base.GetBucketCount();

            for (int i = 0; i < bucketCount; i++)
            {
                CustomColor customColor = new CustomColor();
                if (i < colorRange.Length)
                {
                    customColor.Color = colorRange[i];
                }
                else
                {
                    customColor.Color = Color.Empty;
                }
                if (flag)
                {
                    MapBucket bucket = ((ReportElementCollectionBase <MapBucket>)mapBuckets)[i];
                    customColor.FromValue = base.GetFromValue(bucket);
                    customColor.ToValue   = base.GetToValue(bucket);
                }
                customColors.Add(customColor);
            }
        }
Example #5
0
 private object GetEndValue(Type fieldType)
 {
     if (!this.m_endValueEvaluated)
     {
         if (this.GetDistributionType() == MapRuleDistributionType.Custom)
         {
             MapBucketCollection mapBuckets = this.m_mapRule.MapBuckets;
             if (mapBuckets != null && mapBuckets.Count > 0)
             {
                 ReportVariantProperty endValue = ((ReportElementCollectionBase <MapBucket>)mapBuckets)[mapBuckets.Count - 1].EndValue;
                 if (endValue != null)
                 {
                     if (!endValue.IsExpression)
                     {
                         this.m_endValue = endValue.Value;
                     }
                     this.m_endValue = ((ReportElementCollectionBase <MapBucket>)mapBuckets)[mapBuckets.Count - 1].Instance.EndValue;
                 }
             }
         }
         if (this.m_endValue == null)
         {
             ReportVariantProperty endValue2 = this.m_mapRule.EndValue;
             if (endValue2 != null)
             {
                 if (!endValue2.IsExpression)
                 {
                     this.m_endValue = endValue2.Value;
                 }
                 this.m_endValue = this.m_mapRule.Instance.EndValue;
             }
         }
         if (this.m_endValue != null)
         {
             try
             {
                 this.m_endValue = Convert.ChangeType(this.m_endValue, fieldType, CultureInfo.InvariantCulture);
             }
             catch (Exception e)
             {
                 if (AsynchronousExceptionDetection.IsStoppingException(e))
                 {
                     throw;
                 }
                 this.m_endValue = null;
             }
         }
         this.m_endValueEvaluated = true;
     }
     return(this.m_endValue);
 }
Example #6
0
        protected int GetBucketCount()
        {
            if (!this.IsRuleFieldDefined)
            {
                return(this.m_coreSpatialElementManager.GetSpatialElementCount());
            }
            MapRuleDistributionType distributionType = this.GetDistributionType();
            ReportIntProperty       bucketCount      = this.m_mapRule.BucketCount;
            int num = RuleMapper.m_defaultBucketCount;

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

            case MapRuleDistributionType.Custom:
            {
                MapBucketCollection mapBuckets = this.m_mapRule.MapBuckets;
                if (mapBuckets == null)
                {
                    throw new RenderingObjectModelException(RPRes.rsMapLayerMissingProperty(RPRes.rsObjectTypeMap, this.m_mapRule.MapDef.Name, this.m_mapVectorLayer.Name, "MapBuckets"));
                }
                return(mapBuckets.Count);
            }

            default:
                return(num);
            }
        }
Example #7
0
        private void SetPathRuleSizes(CustomWidthCollection customWidths)
        {
            int bucketCount = base.GetBucketCount();

            if (bucketCount != 0)
            {
                double startSize = this.GetStartSize();
                double num       = (this.GetEndSize() - startSize) / (double)bucketCount;
                MapBucketCollection mapBuckets = base.m_mapRule.MapBuckets;
                bool flag = base.GetDistributionType() == MapRuleDistributionType.Custom;
                for (int i = 0; i < bucketCount; i++)
                {
                    CustomWidth customWidth = new CustomWidth();
                    customWidth.Width = (float)(int)Math.Round(startSize + (double)i * num);
                    if (flag)
                    {
                        MapBucket bucket = ((ReportElementCollectionBase <MapBucket>)mapBuckets)[i];
                        customWidth.FromValue = base.GetFromValue(bucket);
                        customWidth.ToValue   = base.GetToValue(bucket);
                    }
                    customWidths.Add(customWidth);
                }
            }
        }