Exemple #1
0
        /// <summary>
        /// Compares the <see cref="Frame"/> with an <see cref="IFrame"/>.
        /// </summary>
        /// <param name="other">The <see cref="IFrame"/> to compare with the current <see cref="Frame"/>.</param>
        /// <returns>A 32-bit signed integer that indicates the relative order of the objects being compared.</returns>
        /// <remarks>This implementation of a basic frame compares itself by timestamp.</remarks>
        public int CompareTo(IFrame other)
        {
            if ((object)other != null)
            {
                return(m_timestamp.CompareTo(other.Timestamp));
            }

            return(1);
        }
        public int CompareTo(EventInfo other)
        {
            var ticksComparisonResult = Ticks.CompareTo(other.Ticks);

            if (ticksComparisonResult != 0)
            {
                return(ticksComparisonResult);
            }
            return(Id.CompareTo(other.Id));
        }
Exemple #3
0
 /// <summary>
 /// 比较当前与参数指定的时间
 /// </summary>
 /// <param name="other"> 与当前时间做比较的时间 </param>
 /// <returns> 如果当前时间,大于 other 返回 1;小于 other 返回 -1;等于 other 返回 0 </returns>
 public int CompareTo(Time other)
 {
     return(Ticks.CompareTo(other.Ticks));
 }
Exemple #4
0
 /// <summary>
 /// Compares the <see cref="ChannelFrameBase{T}"/> with an <see cref="IFrame"/>.
 /// </summary>
 /// <param name="other">The <see cref="IFrame"/> to compare with the current <see cref="ChannelFrameBase{T}"/>.</param>
 /// <returns>A 32-bit signed integer that indicates the relative order of the objects being compared.</returns>
 /// <remarks>This frame implementation compares itself by timestamp.</remarks>
 public virtual int CompareTo(IFrame other)
 {
     // We sort frames by timestamp
     return(m_timestamp.CompareTo(other.Timestamp));
 }