public virtual void RemoveSegment(int position) { //Valid the position if (position < 1) { throw new ArgumentException("Position must be greater than zero.", "position"); } if (position > Segments.Count) { throw new ArgumentException("Position can be greater than the total number of segments.", "position"); } Segments.RemoveAt(position); Segments[position - 1].SetEnd(Segments[position].Start); }
public virtual void RemoveSegment(int position) { //Valid the position if (position < 1) { throw new ArgumentException("Position must be greater than zero.", "position"); } if (position > Segments.Count) { throw new ArgumentException("Position can be greater than the total number of segments.", "position"); } Origin end = Segments[position].End; Segments.RemoveAt(position); Segments[position - 1].SetEnd(end); DrawPath(); OnElementInvalid(); }