public void ValidateKey(SpatialElementKey spatialElementKey, MapBindingFieldPairCollection mapBindingFieldPairs) { if (this.m_spatialDataMapper.KeyTypes != null) { int num = 0; while (true) { if (num < spatialElementKey.KeyValues.Count) { object obj = spatialElementKey.KeyValues[num]; if (obj != null) { Type type = obj.GetType(); Type type2 = this.m_spatialDataMapper.KeyTypes[num]; if (type2 != null && type != type2) { object obj2 = VectorLayerMapper.Convert(obj, type, type2); if (obj2 == null) { break; } spatialElementKey.KeyValues[num] = obj2; } } num++; continue; } return; } throw new RenderingObjectModelException(RPRes.rsMapFieldBindingExpressionTypeMismatch(RPRes.rsObjectTypeMap, this.m_mapVectorLayer.MapDef.Name, this.m_mapVectorLayer.Name, SpatialDataMapper.GetBindingFieldName(((ReportElementCollectionBase <MapBindingFieldPair>)mapBindingFieldPairs)[num]))); } }
private List <ISpatialElement> GetElementViewSpatialElements(MapElementView mapView) { MapBindingFieldPairCollection mapBindingFieldPairs = mapView.MapBindingFieldPairs; if (mapBindingFieldPairs == null) { return(null); } SpatialElementKey obj = VectorLayerMapper.CreateDataRegionSpatialElementKey(mapBindingFieldPairs); List <ISpatialElement> list = null; foreach (KeyValuePair <SpatialElementKey, SpatialElementInfoGroup> item in this.m_spatialElementsDictionary) { foreach (SpatialElementInfo element in item.Value.Elements) { if (SpatialDataMapper.CreateCoreSpatialElementKey(element.CoreSpatialElement, mapView.MapBindingFieldPairs, this.m_mapVectorLayer.MapDef.Name, this.m_mapVectorLayer.Name).Equals(obj)) { if (list == null) { list = new List <ISpatialElement>(); } list.Add(element.CoreSpatialElement); } } } return(list); }
public SpatialDataSetMapper(VectorLayerMapper vectorLayerMapper, Dictionary <SpatialElementKey, SpatialElementInfoGroup> spatialElementsDictionary, CoreSpatialElementManager spatialElementManager, MapControl coreMap, MapMapper mapMapper) : base(vectorLayerMapper, spatialElementsDictionary, coreMap, mapMapper) { this.m_spatialElementManager = spatialElementManager; this.m_spatialDataSet = (MapSpatialDataSet)base.m_mapVectorLayer.MapSpatialData; this.m_dataSet = this.m_spatialDataSet.DataSet; this.m_dataSetInstance = this.m_dataSet.Instance; }
public SpatialDataMapper(VectorLayerMapper vectorLayerMapper, Dictionary <SpatialElementKey, SpatialElementInfoGroup> spatialElementsDictionary, MapControl coreMap, MapMapper mapMapper) { this.m_vectorLayerMapper = vectorLayerMapper; this.m_mapVectorLayer = this.m_vectorLayerMapper.m_mapVectorLayer; this.m_spatialElementsDictionary = spatialElementsDictionary; this.m_coreMap = coreMap; this.m_mapMapper = mapMapper; }
public RuleMapper(MapAppearanceRule mapRule, VectorLayerMapper vectorLayerMapper, CoreSpatialElementManager coreSpatialElementManager) { this.m_mapRule = mapRule; this.m_mapVectorLayer = vectorLayerMapper.m_mapVectorLayer; this.m_coreMap = vectorLayerMapper.m_coreMap; this.m_coreSpatialElementManager = coreSpatialElementManager; this.m_mapMapper = vectorLayerMapper.m_mapMapper; }
public static SpatialElementKey CreateDataRegionSpatialElementKey(MapBindingFieldPairCollection mapBindingFieldPairs) { List <object> list = new List <object>(); for (int i = 0; i < mapBindingFieldPairs.Count; i++) { list.Add(VectorLayerMapper.EvaluateBindingExpression(((ReportElementCollectionBase <MapBindingFieldPair>)mapBindingFieldPairs)[i])); } return(new SpatialElementKey(list)); }
private static object Convert(object value, Type type, Type conversionType) { TypeCode typeCode = Type.GetTypeCode(conversionType); TypeCode typeCode2 = Type.GetTypeCode(type); switch (typeCode) { case TypeCode.Int32: { int num = default(int); switch (typeCode2) { case TypeCode.Decimal: if (!VectorLayerMapper.TryConvertDecimalToInt((decimal)value, out num)) { break; } return(num); case TypeCode.Double: if (!VectorLayerMapper.TryConvertDoubleToInt((double)value, out num)) { break; } return(num); } break; } case TypeCode.Decimal: if (typeCode2 != TypeCode.Int32) { break; } return((decimal)(int)value); case TypeCode.Double: switch (typeCode2) { case TypeCode.Int32: return((double)(int)value); case TypeCode.Single: return((double)(float)value); } break; } return(null); }
private SpatialElementInfoGroup GetSpatialElementsFromDataRegionKey() { MapBindingFieldPairCollection mapBindingFieldPairs = this.m_mapVectorLayer.MapBindingFieldPairs; if (mapBindingFieldPairs != null) { SpatialElementKey spatialElementKey = VectorLayerMapper.CreateDataRegionSpatialElementKey(mapBindingFieldPairs); this.ValidateKey(spatialElementKey, mapBindingFieldPairs); SpatialElementInfoGroup result = default(SpatialElementInfoGroup); if (this.m_spatialElementsDictionary.TryGetValue(spatialElementKey, out result)) { return(result); } } return(null); }
public ShapefileMapper(VectorLayerMapper vectorLayerMapper, Dictionary <SpatialElementKey, SpatialElementInfoGroup> spatialElementsDictionary, MapControl coreMap, MapMapper mapMapper) : base(vectorLayerMapper, spatialElementsDictionary, coreMap, mapMapper) { this.m_shapefile = (MapShapefile)base.m_mapVectorLayer.MapSpatialData; }
public EmbeddedSpatialDataMapper(VectorLayerMapper vectorLayerMapper, Dictionary <SpatialElementKey, SpatialElementInfoGroup> spatialElementsDictionary, ISpatialElementCollection embeddedCollection, CoreSpatialElementManager spatialElementManager, MapControl coreMap, MapMapper mapMapper) : base(vectorLayerMapper, spatialElementsDictionary, coreMap, mapMapper) { this.m_spatialElementManager = spatialElementManager; this.m_embeddedCollection = embeddedCollection; }
public SizeRuleMapper(MapSizeRule mapColorRule, VectorLayerMapper vectorLayerMapper, CoreSpatialElementManager coreSpatialElementManager) : base(mapColorRule, vectorLayerMapper, coreSpatialElementManager) { }
public PointTemplateMapper(MapMapper mapMapper, VectorLayerMapper vectorLayerMapper, MapVectorLayer mapVectorLayer) : base(mapMapper, mapVectorLayer) { this.m_vectorLayerMapper = vectorLayerMapper; }
protected void RenderSpatialElementTemplate(MapSpatialElementTemplate mapSpatialElementTemplate, ISpatialElement coreSpatialElement, bool ignoreBackgroundColor, bool hasScope) { ReportStringProperty toolTip = mapSpatialElementTemplate.ToolTip; string text = null; if (toolTip != null) { if (!toolTip.IsExpression) { text = toolTip.Value; } else if (hasScope) { text = mapSpatialElementTemplate.Instance.ToolTip; } if (text != null) { text = (coreSpatialElement.ToolTip = VectorLayerMapper.AddPrefixToFieldNames(this.m_mapVectorLayer.Name, text)); } } this.m_mapMapper.RenderActionInfo(mapSpatialElementTemplate.ActionInfo, text, coreSpatialElement, this.m_mapVectorLayer.Name, hasScope); ReportBoolProperty hidden = mapSpatialElementTemplate.Hidden; if (hidden != null) { if (!hidden.IsExpression) { coreSpatialElement.Visible = !hidden.Value; } else if (hasScope) { coreSpatialElement.Visible = !mapSpatialElementTemplate.Instance.Hidden; } else { coreSpatialElement.Visible = true; } } else { coreSpatialElement.Visible = true; } ReportStringProperty label = mapSpatialElementTemplate.Label; if (label != null) { string text3 = ""; if (!label.IsExpression) { text3 = label.Value; } else if (hasScope) { text3 = mapSpatialElementTemplate.Instance.Label; } if (text3 != null) { coreSpatialElement.Text = VectorLayerMapper.AddPrefixToFieldNames(this.m_mapVectorLayer.Name, text3); } } ReportDoubleProperty offsetX = mapSpatialElementTemplate.OffsetX; double x = 0.0; if (offsetX != null) { if (!offsetX.IsExpression) { x = offsetX.Value; } else if (hasScope) { x = mapSpatialElementTemplate.Instance.OffsetX; } coreSpatialElement.Offset.X = x; } offsetX = mapSpatialElementTemplate.OffsetY; x = 0.0; if (offsetX != null) { if (!offsetX.IsExpression) { x = offsetX.Value; } else if (hasScope) { x = mapSpatialElementTemplate.Instance.OffsetY; } coreSpatialElement.Offset.Y = x; } Style style = mapSpatialElementTemplate.Style; StyleInstance style2 = mapSpatialElementTemplate.Instance.Style; this.RenderStyle(style, style2, coreSpatialElement, ignoreBackgroundColor, hasScope); }
public SymbolMarkerTemplateMapper(MapMapper mapMapper, VectorLayerMapper vectorLayerMapper, MapVectorLayer mapVectorLayer) : base(mapMapper, vectorLayerMapper, mapVectorLayer) { }