Exemple #1
0
        //--------------------------------------------------------------------------- IComparable Members

        /// <summary>
        /// Compares the current instance with another object of the same type.
        /// </summary>
        /// <param name="obj">An object to compare with this instance.</param>
        /// <returns>
        /// A 32-bit signed integer that indicates the relative order of the objects being compared. The return value has these meanings: Value Meaning Less than zero This instance is less than obj. Zero This instance is equal to obj. Greater than zero This instance is greater than obj.
        /// </returns>
        /// <exception cref="T:System.ArgumentException">obj is not the same type as this instance. </exception>
        public int CompareTo(object obj)
        {
            VersionNumber x = (VersionNumber)obj;

            if (_major != x._major)
            {
                return(_major.CompareTo(x._major));
            }
            if (_minor != x._minor)
            {
                return(_minor.CompareTo(x._minor));
            }
            return(_status.CompareTo(x._status));
        }