Advertisement
ivandrofly

C# IEqualityComparer

Feb 16th, 2014
225
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.39 KB | None | 0 0
  1. using System.Collections.Generic;
  2. using System.Xml.Linq;
  3.  
  4. namespace Get_Names
  5. {
  6.     class DistinctComparerClass : IEqualityComparer<XElement>
  7.     {
  8.         public bool Equals(XElement x, XElement y)
  9.         {
  10.             return x.Value.Equals(y.Value);
  11.         }
  12.  
  13.         public int GetHashCode(XElement obj)
  14.         {
  15.             return obj.Value.GetHashCode();
  16.         }
  17.     }
  18. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement