예제 #1
0
        /// <summary>
        /// 返回一个新的时段对象,其值为指定的时段对象与此实例的值之差。
        /// </summary>
        /// <param name="span">时段</param>
        /// <returns>新的时段</returns>
        public GnssTimeSpan Subtract(GnssTimeSpan span)
        {
            GnssTime time = _end;

            time.AddSeconds(-span.TotalSeconds);
            return(new GnssTimeSpan(_start, time));
        }
예제 #2
0
 /// <summary>
 /// 时段中是否包含某个时段
 /// </summary>
 /// <param name="span">时段</param>
 /// <returns>是否在其中</returns>
 public bool Contains(GnssTimeSpan span)
 {
     return((_end.CompareTo(span.End) >= 0) && (_start.CompareTo(span.Start) <= 0));
 }