public override void Populate()
        {
            this.SubscribeToAddedEvent();
            string[] columnsToImport   = default(string[]);
            string[] destinationFields = default(string[]);
            this.GetFieldNameMapping(out columnsToImport, out destinationFields);
            Stream stream = this.m_shapefile.Instance.Stream;

            if (stream != null)
            {
                base.m_coreMap.mapCore.MaxSpatialElementCount = base.m_mapMapper.RemainingSpatialElementCount;
                base.m_coreMap.mapCore.MaxSpatialPointCount   = base.m_mapMapper.RemainingTotalPointCount;
                switch (base.m_coreMap.mapCore.LoadFromShapeFileStreams(stream, this.m_shapefile.Instance.DBFStream, columnsToImport, destinationFields, base.m_mapVectorLayer.Name, base.m_mapVectorLayer.Name))
                {
                case SpatialLoadResult.MaxSpatialElementCountReached:
                    base.m_coreMap.Viewport.ErrorMessage = RPRes.rsMapMaximumSpatialElementCountReached(RPRes.rsObjectTypeMap, base.m_mapVectorLayer.MapDef.Name);
                    break;

                case SpatialLoadResult.MaxSpatialPointCountReached:
                    base.m_coreMap.Viewport.ErrorMessage = RPRes.rsMapMaximumTotalPointCountReached(RPRes.rsObjectTypeMap, base.m_mapVectorLayer.MapDef.Name);
                    break;
                }
                this.UnsubscribeToAddedEvent();
                return;
            }
            throw new RenderingObjectModelException(RPRes.rsMapCannotLoadShapefile(RPRes.rsObjectTypeMap, base.m_mapVectorLayer.MapDef.Name, this.m_shapefile.Instance.Source));
        }
        internal override void Populate()
        {
            SubscribeToAddedEvent();
            GetFieldNameMapping(out string[] dbfNames, out string[] uniqueNames);
            Stream stream = m_shapefile.Instance.Stream;

            if (stream != null)
            {
                m_coreMap.mapCore.MaxSpatialElementCount = m_mapMapper.RemainingSpatialElementCount;
                m_coreMap.mapCore.MaxSpatialPointCount   = m_mapMapper.RemainingTotalPointCount;
                switch (m_coreMap.mapCore.LoadFromShapeFileStreams(stream, m_shapefile.Instance.DBFStream, dbfNames, uniqueNames, m_mapVectorLayer.Name, m_mapVectorLayer.Name))
                {
                case SpatialLoadResult.MaxSpatialElementCountReached:
                    m_coreMap.Viewport.ErrorMessage = RPRes.rsMapMaximumSpatialElementCountReached(RPRes.rsObjectTypeMap, m_mapVectorLayer.MapDef.Name);
                    break;

                case SpatialLoadResult.MaxSpatialPointCountReached:
                    m_coreMap.Viewport.ErrorMessage = RPRes.rsMapMaximumTotalPointCountReached(RPRes.rsObjectTypeMap, m_mapVectorLayer.MapDef.Name);
                    break;
                }
                UnsubscribeToAddedEvent();
                return;
            }
            throw new RenderingObjectModelException(RPRes.rsMapCannotLoadShapefile(RPRes.rsObjectTypeMap, m_mapVectorLayer.MapDef.Name, m_shapefile.Instance.Source));
        }