public void Add(TrackStretch stretch) { if (stretch == null) { throw new ArgumentNullException(nameof(stretch)); } if (Stretches.Count > 0 && stretch.End.Station.Equals(Stretches.Last().Start.Station)) { Stretches.Insert(0, stretch); } else { Stretches.Add(stretch); } }
public override string ToString() { return(string.Format(CultureInfo.CurrentCulture, "{0}: {1} - {2}", Number, Stretches[0].Start.Station, Stretches.Last().End.Station)); }