Exemple #1
0
        /// <summary>
        /// <see cref="TrainDataParseException"/>クラスの新しいインスタンスを初期化します。
        /// </summary>
        /// <param name="rawTrainData">エラーを発生させたデータ。</param>
        public TrainDataParseException(RawTrainData rawTrainData)

        {
            Debuggers.LogWriter.WriteExceptionLog(this);
            Debuggers.LogWriter.WriteObjectLog(rawTrainData);
            RawTrainData = rawTrainData;
        }
Exemple #2
0
        /// <summary>
        /// <see cref="TrainDataParseException"/>クラスの新しいインスタンスを初期化します。
        /// </summary>
        /// <param name="rawTrainData">エラーを発生させたデータ。</param>
        /// <param name="message">エラーメッセージ。</param>
        /// <param name="inner">内部例外。</param>
        public TrainDataParseException(RawTrainData rawTrainData, string message, Exception inner) : base(message, inner)

        {
            Debuggers.LogWriter.WriteExceptionLog(this);
            Debuggers.LogWriter.WriteObjectLog(rawTrainData);
            RawTrainData = rawTrainData;
        }
Exemple #3
0
 public static TrainData ParseTrainData(RawTrainData rawTrainData, int getedHour, Station station, TrainData.ArrivalTypes arrivalTypes)
 {
     try
     {
         var name        = TrainNameParser.GetTrainName(rawTrainData.TrainName, rawTrainData.TrainType);
         var time        = TrainTimeParser.GetTrainTime(rawTrainData.Time, getedHour);
         var destination = TrainDestParser.GetTrainDestination(rawTrainData.Destination);
         var condition   = TrainConditionParser.GetTrainCondition((TrainData.TrainConditions)rawTrainData.Status, rawTrainData.Addition, rawTrainData.NowPosition);
         var nowPosition = TrainPositionTextParser.GetTrainPosition(rawTrainData.NowPosition);
         return(new TrainData(name, time, station, arrivalTypes, destination, condition, nowPosition));
     }
     catch (Exception ex)
     {
         throw new TrainDataParseException(rawTrainData, "列車データのパースに失敗しました", ex);
     }
 }