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 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])));
     }
 }
        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 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);
        }
示例#5
0
        public static SpatialElementKey CreateCoreSpatialElementKey(ISpatialElement coreSpatialElement, MapBindingFieldPairCollection mapBindingFieldPairs, string mapName, string layerName)
        {
            if (mapBindingFieldPairs == null)
            {
                return(new SpatialElementKey(null));
            }
            List <object> list = new List <object>();

            for (int i = 0; i < mapBindingFieldPairs.Count; i++)
            {
                list.Add(SpatialDataMapper.GetBindingFieldValue(coreSpatialElement, ((ReportElementCollectionBase <MapBindingFieldPair>)mapBindingFieldPairs)[i], mapName, layerName));
            }
            return(new SpatialElementKey(list));
        }