示例#1
0
        public bool IsNewerThan(Versioned other)
        {
            // We are always newer than null.
            if (other == null)
            {
                return(true);
            }

            // Anything with a valid timestamp always is
            // more recent than something w/o a timestamp.
            if (ValidTimestamp || other.ValidTimestamp)
            {
                if (other.ValidTimestamp)
                {
                    return(IsNewerThan(other.Timestamp));
                }
                else
                {
                    return(true);
                }
            }

            return(false);
        }
示例#2
0
        public bool IsObsoletedBy(Versioned other)
        {
            // We are never obsoleted by null.
            if (other == null)
            {
                return(false);
            }

            // Anything with a valid timestamp always is
            // more recent than something w/o a timestamp.
            if (ValidTimestamp || other.ValidTimestamp)
            {
                if (other.ValidTimestamp)
                {
                    return(IsObsoletedBy(other.Timestamp));
                }
                else
                {
                    return(false);
                }
            }

            return(false);
        }