コード例 #1
0
 /// <summary>Implementation of IComparable.CompareTo()</summary>
 /// <param name="obj"> The object to compare to </param>
 /// <returns> 0 if the HierarchyIds are "equal" (i.e., have the same _hierarchyId value) </returns>
 public int CompareTo(object obj)
 {
     if (obj as HierarchyId != (HierarchyId)null)
     {
         return(HierarchyId.Compare(this, (HierarchyId)obj));
     }
     return(-1);
 }
コード例 #2
0
 /// <summary>Compares two HierarchyIds by their values.</summary>
 /// <param name="hid1"> a HierarchyId to compare </param>
 /// <param name="hid2"> a HierarchyId to compare </param>
 /// <returns> true if the two HierarchyIds are equal, false otherwise </returns>
 public static bool operator ==(HierarchyId hid1, HierarchyId hid2)
 {
     return(HierarchyId.Compare(hid1, hid2) == 0);
 }