Beispiel #1
0
        private int GetFieldIndex(string fieldName)
        {
            int fieldIndex = this.m_dataSet.NonCalculatedFields.GetFieldIndex(fieldName);

            if (fieldIndex == -1)
            {
                throw new RenderingObjectModelException(RPRes.rsMapInvalidFieldName(RPRes.rsObjectTypeMap, base.m_mapVectorLayer.MapDef.Name, base.m_mapVectorLayer.Name, fieldName));
            }
            return(fieldIndex);
        }
        private void ProcessNonSpatialFields(MapSpatialElement embeddedElement, ISpatialElement spatialElement)
        {
            MapFieldCollection mapFields = embeddedElement.MapFields;

            if (mapFields != null)
            {
                MapFieldDefinitionCollection mapFieldDefinitions = base.m_mapVectorLayer.MapFieldDefinitions;
                if (mapFieldDefinitions != null)
                {
                    foreach (MapField item in mapFields)
                    {
                        MapFieldDefinition fieldDefinition = mapFieldDefinitions.GetFieldDefinition(item.Name);
                        if (fieldDefinition == null)
                        {
                            throw new RenderingObjectModelException(RPRes.rsMapInvalidFieldName(RPRes.rsObjectTypeMap, base.m_mapVectorLayer.MapDef.Name, base.m_mapVectorLayer.Name, item.Name));
                        }
                        this.m_spatialElementManager.AddFieldValue(spatialElement, base.GetUniqueFieldName(item.Name), this.GetFieldValue(item.Value, fieldDefinition.DataType));
                    }
                }
            }
        }