Exemplo n.º 1
0
        /// <summary>
        /// Contains 目标时刻是否在时间范围内
        /// </summary>
        public bool Contains(ShortTime target)
        {
            bool bStart = this.shortTimeStart.CompareTo(target) <= 0;
            bool bEnd   = this.shortTimeEnd.CompareTo(target) >= 0;

            return(bStart && bEnd);
        }
Exemplo n.º 2
0
        public ShortTimeScope(ShortTime first, ShortTime later)
        {
            this.shortTimeStart = first;
            this.shortTimeEnd   = later;

            if (first.CompareTo(later) >= 0)
            {
                throw new Exception("the parameter later must be greatter than first!");
            }
        }