Public Sub GetAllSegments( _ ByRef segments As ICollection(Of Segment) _ )
public void GetAllSegments( ref ICollection<Segment> segments )
Parameters
- segments
- The collection of segments. If segments is null, a list will be allocated.
Public Sub GetAllSegments( _ ByRef segments As ICollection(Of Segment) _ )
public void GetAllSegments( ref ICollection<Segment> segments )
{
ICollection<Segment> collectionSegments = new List<Segment>();
polyline.GetAllSegments(ref collectionSegments);
int numSegmentsInCollection = collectionSegments.Count; // = 10
IList<Segment> iList = collectionSegments as IList<Segment>;
for (int i = 0; i < numSegmentsInCollection; i++)
{
// do something with iList[i]
}
// use the segments to build another polyline
Polyline polylineFromSegments = PolylineBuilderEx.CreatePolyline(collectionSegments);
}
{
List<Segment> segmentList = new List<Segment>(30);
ICollection<Segment> collection = segmentList;
polygon.GetAllSegments(ref collection);
// segmentList.Count = 4
// segmentList.Capacity = 30
// use the segments to build another polygon
Polygon polygonFromSegments = PolygonBuilderEx.CreatePolygon(collection);
}
Target Platforms: Windows 11 Home, Pro, Enterprise (64 bit)