Replaces a segment at the specified index in the part. The points of the part can change if the input segment is not coincident with the start and end points of the segment that's being replaced.
the segment that was replaced.
Zero-based index of the segment.
The segment to be set into the collection.