//Methods
        public virtual Segment AddSegment(int position, Origin origin)
        {
            //Valid the position
            if (position < 1)
            {
                throw new ArgumentException("Position must be greater than zero.", "position");
            }
            if (position > Segments.Count)
            {
                throw new ArgumentException("Position cannot be greater than the total number of segments.", "position");
            }
            if (origin == null)
            {
                throw new ArgumentNullException("origin", "Origin may not be null.");
            }

            //Create new segment
            Segment segment = new Segment(origin, Segments[position - 1].End);

            //Set the previous end to the new origin
            Segments[position - 1].SetEnd(origin);

            Segments.Insert(position, segment);

            origin.OriginInvalid   += new EventHandler(Origin_OriginInvalid);
            segment.SegmentInvalid += new EventHandler(segment_SegmentInvalid);
            origin.SetLine(this);

            DrawPath();
            OnElementInvalid();

            return(segment);
        }