Exemple #1
0
        /// <summary>
        /// Compares this object to another for sorting purposes
        /// </summary>
        /// <param name="obj">Other object</param>
        /// <returns>Sort value</returns>
        /// <remarks>See <see cref="SortLong"/> for configuration of this value</remarks>
        public int CompareTo(object obj)
        {
            if (obj == null)
            {
                throw new ArgumentNullException();
            }
            if (obj.GetType() != typeof(ShortName))
            {
                throw new ArgumentException("Expecting argument of type ShortName");
            }
            var o = (ShortName)obj;

            return(SortLong ? Long.CompareTo(o.Long) : Short.CompareTo(o.Short));
        }