コード例 #1
0
ファイル: DiffElement.cs プロジェクト: orf53975/DiffLib
 public bool Equals(DiffElement <T> other)
 {
     return
         (ElementIndexFromCollection1.Equals(other.ElementIndexFromCollection1) &&
          ElementFromCollection1.Equals(other.ElementFromCollection1) &&
          ElementIndexFromCollection2.Equals(other.ElementIndexFromCollection2) &&
          ElementFromCollection2.Equals(other.ElementFromCollection2) &&
          Operation == other.Operation);
 }
コード例 #2
0
        private T GetElement(DiffElement <T> diffElement)
        {
            if (diffElement.ElementFromCollection1.HasValue)
            {
                return(diffElement.ElementFromCollection1.Value);
            }

            if (diffElement.ElementFromCollection2.HasValue)
            {
                return(diffElement.ElementFromCollection2.Value);
            }

            return(default(T));
        }
コード例 #3
0
 public int GetHashCode(DiffElement <T> obj)
 {
     return(_Comparer.GetHashCode(GetElement(obj)));
 }
コード例 #4
0
 public bool Equals(DiffElement <T> x, DiffElement <T> y)
 {
     return(_Comparer.Equals(GetElement(x), GetElement(y)));
 }