Light12306/Web12306/Servers/TrainSuggestion/Elapsedtime.cs

47 lines
767 B
C#
Raw Normal View History

2015-03-13 19:25:08 +08:00
namespace Web12306.Servers.TrainSuggestion
{
using System;
using Newtonsoft.Json;
public class Elapsedtime
{
public string days { get; set; }
public string total { get; set; }
TimeSpan? _elTimeSpan;
[JsonIgnore]
public TimeSpan Value
{
get
{
if (_elTimeSpan == null)
{
_elTimeSpan = Cn12306SuggestionUtility.GetTimeValueSpan(total);
}
return _elTimeSpan.Value;
}
}
TimeSpan? _maxAddTime;
/// <summary>
/// 最大允许加时
/// </summary>
[JsonIgnore]
public TimeSpan MaxAddTime
{
get
{
if (_maxAddTime == null)
{
_maxAddTime = new TimeSpan(0, 0, 0, (int)(Value.TotalSeconds * Cn12306SuggestionUtility.TimeRangeLimitRadio));
}
return _maxAddTime.Value;
}
}
}
}