private void SetSymbolRuleColors(Color[] colorRange, PredefinedSymbolCollection customSymbols) { MapBucketCollection mapBuckets = m_mapRule.MapBuckets; bool flag = GetDistributionType() == MapRuleDistributionType.Custom; int bucketCount = 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 = mapBuckets[i]; predefinedSymbol.FromValue = GetFromValue(bucket); predefinedSymbol.ToValue = GetToValue(bucket); } customSymbols.Add(predefinedSymbol); } }
private void SetRuleColors(Color[] colorRange, CustomColorCollection customColors) { MapBucketCollection mapBuckets = m_mapRule.MapBuckets; bool flag = GetDistributionType() == MapRuleDistributionType.Custom; int bucketCount = 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 = mapBuckets[i]; customColor.FromValue = GetFromValue(bucket); customColor.ToValue = GetToValue(bucket); } customColors.Add(customColor); } }
private void SetSymbolRuleSizes(PredefinedSymbolCollection customSymbols) { int bucketCount = GetBucketCount(); if (bucketCount == 0) { return; } double startSize = GetStartSize(); double num = (GetEndSize() - startSize) / (double)bucketCount; MapBucketCollection mapBuckets = m_mapRule.MapBuckets; bool flag = GetDistributionType() == MapRuleDistributionType.Custom; for (int i = 0; i < bucketCount; i++) { PredefinedSymbol predefinedSymbol = new PredefinedSymbol(); float num4 = predefinedSymbol.Width = (predefinedSymbol.Height = (int)Math.Round(startSize + (double)i * num)); if (flag) { MapBucket bucket = mapBuckets[i]; predefinedSymbol.FromValue = GetFromValue(bucket); predefinedSymbol.ToValue = GetToValue(bucket); } customSymbols.Add(predefinedSymbol); } }
private void SetPathRuleSizes(CustomWidthCollection customWidths) { int bucketCount = GetBucketCount(); if (bucketCount == 0) { return; } double startSize = GetStartSize(); double num = (GetEndSize() - startSize) / (double)bucketCount; MapBucketCollection mapBuckets = m_mapRule.MapBuckets; bool flag = GetDistributionType() == MapRuleDistributionType.Custom; for (int i = 0; i < bucketCount; i++) { CustomWidth customWidth = new CustomWidth(); customWidth.Width = (int)Math.Round(startSize + (double)i * num); if (flag) { MapBucket bucket = mapBuckets[i]; customWidth.FromValue = GetFromValue(bucket); customWidth.ToValue = GetToValue(bucket); } customWidths.Add(customWidth); } }
private void SetSymbolRuleMarkers(PredefinedSymbolCollection customSymbols) { int bucketCount = GetBucketCount(); MapMarkerCollection mapMarkers = ((MapMarkerRule)m_mapRule).MapMarkers; int count = mapMarkers.Count; MapBucketCollection mapBuckets = m_mapRule.MapBuckets; bool flag = GetDistributionType() == MapRuleDistributionType.Custom; for (int i = 0; i < bucketCount; i++) { PredefinedSymbol predefinedSymbol = new PredefinedSymbol(); if (i < count) { RenderMarker(predefinedSymbol, mapMarkers[i]); } else { predefinedSymbol.MarkerStyle = MarkerStyle.None; } if (flag) { MapBucket bucket = mapBuckets[i]; predefinedSymbol.FromValue = GetFromValue(bucket); predefinedSymbol.ToValue = GetToValue(bucket); } customSymbols.Add(predefinedSymbol); } }
private object GetEndValue(Type fieldType) { if (!m_endValueEvaluated) { if (GetDistributionType() == MapRuleDistributionType.Custom) { MapBucketCollection mapBuckets = m_mapRule.MapBuckets; if (mapBuckets != null && mapBuckets.Count > 0) { ReportVariantProperty endValue = mapBuckets[mapBuckets.Count - 1].EndValue; if (endValue != null) { if (!endValue.IsExpression) { m_endValue = endValue.Value; } m_endValue = mapBuckets[mapBuckets.Count - 1].Instance.EndValue; } } } if (m_endValue == null) { ReportVariantProperty endValue2 = m_mapRule.EndValue; if (endValue2 != null) { if (!endValue2.IsExpression) { m_endValue = endValue2.Value; } m_endValue = m_mapRule.Instance.EndValue; } } if (m_endValue != null) { try { m_endValue = Convert.ChangeType(m_endValue, fieldType, CultureInfo.InvariantCulture); } catch (Exception e) { if (AsynchronousExceptionDetection.IsStoppingException(e)) { throw; } m_endValue = null; } } m_endValueEvaluated = true; } return(m_endValue); }