Polyline Curve explode c#

See also for a more general approach also see those older posts: