コード例 #1
0
 /// <summary>Indicates whether the current object is equal to another object of the same type.</summary>
 /// <param name="other">An object to compare with this object.</param>
 /// <returns>true if the current object is equal to the <paramref name="other" /> parameter; otherwise, false.</returns>
 public bool Equals(TextValueItem <T> other)
 {
     if (other == null)
     {
         return(false);
     }
     return(Text == other.Text && (Value?.Equals(other.Value) ?? false));
 }
コード例 #2
0
 /// <summary>Compares the current object with another object of the same type.</summary>
 /// <param name="other">An object to compare with this object.</param>
 /// <returns>
 /// A 32-bit signed integer 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>
 public int CompareTo(TextValueItem <T> other) => string.Compare(Text, other?.Text, StringComparison.CurrentCulture);