private static MapPoint GetLastPoint(Geometry geometry)
        {
            MapPoint lastPoint = null;
            IEnumerable <PointCollection> pointCollections = null;

            if (geometry is Polygon)
            {
                pointCollections = ((Polygon)geometry).Rings;
            }
            else if (geometry is Polyline)
            {
                pointCollections = ((Polyline)geometry).Paths;
            }

            if (pointCollections != null)
            {
                PointCollection lastPointCollection = pointCollections.LastOrDefault();
                if (lastPointCollection != null)
                {
                    lastPoint = lastPointCollection.LastOrDefault();
                }
            }

            return(lastPoint);
        }
Ejemplo n.º 2
0
 public void UpdateLastPoint(Point point)
 {
     if (_points.Count > 1)
     {
         _points.Remove(_points.LastOrDefault());
     }
     AddPoint(point);
 }