コード例 #1
0
 /// <summary>
 /// Check if this instance is equal to another object that
 /// implements <see cref="IComponentMetaData"/>.
 /// </summary>
 /// <param name="other">
 /// The <see cref="IComponentMetaData"/> to check for equality
 /// </param>
 /// <returns>
 /// True if the two instances are equal.
 /// False otherwise
 /// </returns>
 public bool Equals(IComponentMetaData other)
 {
     if (other == null)
     {
         return(false);
     }
     return(ComponentId.Equals(other.ComponentId));
 }
コード例 #2
0
 /// <summary>
 /// Compare this instance to another object that implements
 /// <see cref="IComponentMetaData"/>.
 /// </summary>
 /// <param name="other">
 /// The <see cref="IComponentMetaData"/> instance to compare to.
 /// </param>
 /// <returns>
 /// &gt;0 if this instance precedes `other` in the sort order.
 /// 0 if they are equal in the sort order.
 /// &lt;0 if `other` precedes this instance in the sort order.
 /// </returns>
 public int CompareTo(IComponentMetaData other)
 {
     if (other == null)
     {
         return(-1);
     }
     return(ComponentId.CompareTo(other.ComponentId));
 }