private bool ContainsPair(UnorderedReferencePair pair) { #if CLR_2_0 || CLR_4_0 return(table.ContainsKey(pair)); #else return(table.Contains(pair)); #endif }
/// <summary> /// Check whether two objects have previously /// been compared, returning true if they have. /// The two objects are remembered, so that a /// second call will always return true. /// </summary> public bool CheckRecursion(IEnumerable expected, IEnumerable actual) { var pair = new UnorderedReferencePair(expected, actual); if (ContainsPair(pair)) { return(true); } table.Add(pair, null); return(false); }
public bool Equals(UnorderedReferencePair other) { return((ReferenceEquals(first, other.first) && ReferenceEquals(second, other.second)) || (ReferenceEquals(first, other.second) && ReferenceEquals(second, other.first))); }
private bool ContainsPair(UnorderedReferencePair pair) { return(table.ContainsKey(pair)); }