Пример #1
0
 /// <summary>
 ///     Indicates whether the current object is equal to another object of the same type.
 /// </summary>
 /// <returns>
 ///     true if the current object is equal to the <paramref name="other" /> parameter; otherwise, false.
 /// </returns>
 /// <param name="other">An object to compare with this object.</param>
 public bool Equals(KeyedItem <TKey, TValue> other)
 {
     if (other == null)
     {
         return(false);
     }
     if (Item == null)
     {
         return(other.Item == null);
     }
     return(Item.Equals(other.Item));
 }
Пример #2
0
 /// <summary>
 ///     Compares the current object with another object of the same type.
 /// </summary>
 /// <returns>
 ///     A value that indicates the relative order of the objects being compared. The return value has the following
 ///     meanings: Value Meaning Less than zero This object is less than the <paramref name="other" /> parameter.Zero This
 ///     object is equal to <paramref name="other" />. Greater than zero This object is greater than
 ///     <paramref name="other" />.
 /// </returns>
 /// <param name="other">An object to compare with this object.</param>
 public int CompareTo(KeyedItem <TKey, TValue> other)
 {
     if (other == null)
     {
         return(-1);
     }
     if (Item == null)
     {
         return(other.Item == null ? 0 : -1);
     }
     return(Item.CompareTo(other.Item));
 }