Ejemplo n.º 1
0
        /// <summary>
        ///     Compares this instance with a specified VersionToken and indicates whether this instances precedes, follows, or
        ///     represents the same version.
        /// </summary>
        /// <param name="other">A VersionToken to compare with.</param>
        /// <returns>A 32-bit signed integer indicating whether this instances precedes, follows, or represents the same version.</returns>
        public int CompareTo(VersionToken other)
        {
            if (_target == null)
            {
                return(-1);
            }

            if (other._target == null)
            {
                return(1);
            }

            if (_target == other._target)
            {
                return(_number.CompareTo(other._number));
            }

            var check = _target.CompareToExtracted(other._target);

            return(check == 0 ? _number.CompareTo(other._number) : check);
        }