Exemple #1
0
        /// <summary>
        /// Returns the hashcode for this instance.
        /// </summary>
        /// <returns>The hashcode for this instance.</returns>
        public override int GetHashCode()
        {
            int retVal = ModeChar.GetHashCode();

            retVal ^= IsAdded.GetHashCode();
            retVal ^= Parameter == null ? 0 : Parameter.GetHashCode();

            return(retVal);
        }
Exemple #2
0
        /// <summary>
        /// Compares this instance to a specified <see cref="System.Object"/> and indicates whether this instance
        /// precedes, follows, or appears in the same sort order as the specified <see cref="System.Object"/>.
        /// </summary>
        /// <param name="obj">A <see cref="System.Object"/> to compare.</param>
        /// <returns>A -1 if this instance precedes the specified object, 1 if it follows, or 0 if it appears in the same position.</returns>
        public int CompareTo(object obj)
        {
            if (!(obj is Mode))
            {
                throw new ArgumentException("Object must be of type Irc.Mode");
            }

            int retVal = 1;

            if (obj != null)
            {
                retVal = ModeChar.CompareTo(((Mode)obj).ModeChar);
            }
            return(retVal);
        }
Exemple #3
0
 /// <summary>
 /// Converts the value of this instance to its string representation.
 /// </summary>
 /// <returns>The string representation of this instance.</returns>
 public override string ToString()
 {
     return(ModeChar.ToString());
 }