コード例 #1
0
ファイル: DateRange.cs プロジェクト: arangas/MediaPortal-1
    /// <summary>
    /// Initializes a new instance of the <see cref="DateRange"/> class.
    /// </summary>
    /// <param name="start">The start.</param>
    /// <param name="end">The end.</param>
    public DateRange(string start, string end)
    {
      _start = new BasicDate(start);
      _end = new BasicDate(end);
      _overYear = false;

      if (_end.Month < _start.Month)
      {
        _overYear = true;
      }
    }
コード例 #2
0
ファイル: DateRange.cs プロジェクト: thomasr3/MediaPortal-1
        /// <summary>
        /// Initializes a new instance of the <see cref="DateRange"/> class.
        /// </summary>
        /// <param name="start">The start.</param>
        /// <param name="end">The end.</param>
        public DateRange(string start, string end)
        {
            _start    = new BasicDate(start);
            _end      = new BasicDate(end);
            _overYear = false;

            if (_end.Month < _start.Month)
            {
                _overYear = true;
            }
        }
コード例 #3
0
ファイル: DateRange.cs プロジェクト: thomasr3/MediaPortal-1
        /// <summary>
        /// Determines whether [is in range] [the specified time].
        /// </summary>
        /// <param name="time">The time.</param>
        /// <returns>
        ///     <c>true</c> if [is in range] [the specified time]; otherwise, <c>false</c>.
        /// </returns>
        public bool IsInRange(long time)
        {
            var checkTime = new BasicDate(time);

            if (_overYear)
            {
                if (_start < checkTime && checkTime.Month < 12 ||
                    _end > checkTime && checkTime.Month >= 1)
                {
                    return(true);
                }
            }
            else
            {
                if (_start < checkTime && _end > checkTime)
                {
                    return(true);
                }
            }
            return(false);
        }
コード例 #4
0
ファイル: DateRange.cs プロジェクト: arangas/MediaPortal-1
    /// <summary>
    /// Determines whether [is in range] [the specified time].
    /// </summary>
    /// <param name="time">The time.</param>
    /// <returns>
    /// 	<c>true</c> if [is in range] [the specified time]; otherwise, <c>false</c>.
    /// </returns>
    public bool IsInRange(long time)
    {
      var checkTime = new BasicDate(time);

      if (_overYear)
      {
        if (_start < checkTime && checkTime.Month < 12 ||
            _end > checkTime && checkTime.Month >= 1)
        {
          return true;
        }
      }
      else
      {
        if (_start < checkTime && _end > checkTime)
        {
          return true;
        }
      }
      return false;
    }