/// <summary> /// Determines whether the specified objects are equal /// </summary> /// <param name="x">The first object of type T to compare.</param> /// <param name="y">The second object of type T to compare.</param> /// <returns>true if the specified objects are equal; otherwise, false.</returns> public bool Equals(FileFilterItemCollection x, FileFilterItemCollection y) { if (x == null && y == null) { return(true); } if (x == null || y == null) { return(false); } if (x.Count != y.Count) { return(false); } return(!x.Where((t, i) => !t.Equals(y[i])).Any()); }
/// <summary> /// Returns a hash code for the specified object /// </summary> /// <param name="obj">The <see cref="T:System.Object"></see> for which a hash code is to be returned.</param> /// <returns>A hash code for the specified object.</returns> /// <exception cref="T:System.ArgumentNullException">The type of <paramref name="obj">obj</paramref> is a reference type and <paramref name="obj">obj</paramref> is null.</exception> public int GetHashCode(FileFilterItemCollection obj) { return(obj.Select(x => x.GetHashCode()).Sum()); }