object shapeItem = 1;
Shape objShape = axMappointControl1.ActiveMap.Shapes.get_Item(ref shapeItem);
if (objShape != null)
{
if (objShape.Type == GeoShapeType.geoTextBox || objShape.Type == GeoShapeType.geoFreeform)
{ List<Gen_Zone_PolyVertice> list = new List<Gen_Zone_PolyVertice>();
int? lineWeight = null;
int? lineForeColor = null;
System.Drawing.Color myColor = System.Drawing.Color.Red;
int iRed = System.Drawing.ColorTranslator.ToOle(myColor);
string shapeType = "";
foreach (Shape shp in axMappointControl1.ActiveMap.Shapes)
{
if (shp.Line.ForeColor == iRed || shp.Name.ToString() == "text")
{
continue;
}
if (lineWeight == null)
{
lineWeight = shp.Line.Weight;
}
if (lineForeColor == null)
{
lineForeColor = shp.Line.ForeColor;
}
try
{
shapeType = "";
List<MapPoint.Location> locArr = ((object[])shp.Vertices).Select(c => (MapPoint.Location)c).ToList<MapPoint.Location>();
list.AddRange((from a in locArr
select new Gen_Zone_PolyVertice
{
PostCode = "",
Latitude = a.Latitude,
Longitude = a.Longitude
}).ToList());
}
catch (Exception ex)
{}