コード例 #1
0
 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);
     }
 }
コード例 #2
0
 public override string ToString()
 {
     return(string.Format(CultureInfo.CurrentCulture, "{0}: {1} - {2}", Number, Stretches[0].Start.Station, Stretches.Last().End.Station));
 }