コード例 #1
0
        public TripEvent(string date, string time, TimeType timeType, string station, string code)
        {
            var dateParts = date.Split('.').Select(x => int.Parse(x));
            var timeParts = time.Split(':').Select(x => int.Parse(x));

            DateAndTime = new DateTime(
                dateParts.ElementAt(2), dateParts.ElementAt(1), dateParts.ElementAt(0),
                timeParts.ElementAt(0), timeParts.ElementAt(1), timeParts.ElementAtOrDefault(2));
            TimeType = timeType;
            Station  = new RailStation(station, code);
        }
コード例 #2
0
 public TripEvent(DateTime dateAndTime, TimeType timeType, string station, string code)
 {
     DateAndTime = dateAndTime;
     TimeType    = timeType;
     Station     = new RailStation(station, code);
 }