public PolylineBuilder( IEnumerable<MapPoint> points )
Public Function New( _ ByVal points As IEnumerable(Of MapPoint) _ )
Parameters
- points
- Points for the first part.
public PolylineBuilder( IEnumerable<MapPoint> points )
Public Function New( _ ByVal points As IEnumerable(Of MapPoint) _ )
Exception | Description |
---|---|
System.InvalidOperationException | Incompatible spatial references |
ArcGIS.Core.CalledOnWrongThreadException | This method or property must be called within the lambda passed to QueuedTask.Run. |
System.ArgumentNullException | points is null. |
List<MapPoint> firstPoints = new List<MapPoint>(); firstPoints.Add(MapPointBuilder.CreateMapPoint(1.0, 1.0)); firstPoints.Add(MapPointBuilder.CreateMapPoint(1.0, 2.0)); firstPoints.Add(MapPointBuilder.CreateMapPoint(2.0, 2.0)); firstPoints.Add(MapPointBuilder.CreateMapPoint(2.0, 1.0)); List<MapPoint> nextPoints = new List<MapPoint>(); nextPoints.Add(MapPointBuilder.CreateMapPoint(11.0, 1.0)); nextPoints.Add(MapPointBuilder.CreateMapPoint(11.0, 2.0)); nextPoints.Add(MapPointBuilder.CreateMapPoint(12.0, 2.0)); nextPoints.Add(MapPointBuilder.CreateMapPoint(12.0, 1.0)); // Builder constructors need to run on the MCT. ArcGIS.Desktop.Framework.Threading.Tasks.QueuedTask.Run(() => { using (PolylineBuilder pBuilder = new PolylineBuilder(firstPoints)) { pBuilder.AddPart(nextPoints); Polyline polyline = pBuilder.ToGeometry(); // polyline p has 2 parts pBuilder.RemovePart(0); polyline = pBuilder.ToGeometry(); // polyline p has 1 part } });
Target Platforms: Windows 10, Windows 8.1, Windows 7