/// <summary> /// Instantiates a new instance of the <see cref="ObjectComparer{T,U}"/> class. /// </summary> /// <param name="yield">The method used to yield the member value of the compared objects.</param> /// <param name="invertComparison">Indicates whether results are evaluated inversely.</param> /// <param name="ignoreCase">Indicates whether the case of values is ignored.</param> /// <exception cref="ArgumentNullException"><i>yield</i> is a null reference (Nothing in Visual Basic)</exception> public ObjectComparer(YieldMember<T, U> yield, bool invertComparison, bool ignoreCase) { if ((_yield = yield) == null) throw new ArgumentNullException("yield"); // set properties IgnoreCase = ignoreCase; InvertComparison = invertComparison; ObjectIsNullable = !typeof(T).IsValueType; ValueIsNullable = !typeof(U).IsValueType; }
/// <summary> /// Instantiates a new instance of the <see cref="ObjectComparer{T,U}"/> class. /// </summary> /// <param name="yield">The method used to yield the member value of the compared objects.</param> /// <param name="invertComparison">Indicates whether results are evaluated inversely.</param> /// <exception cref="ArgumentNullException"><i>yield</i> is a null reference (Nothing in Visual Basic)</exception> public ObjectComparer(YieldMember<T, U> yield, bool invertComparison) : this(yield, invertComparison, true) { }
/// <summary> /// Instantiates a new instance of the <see cref="ObjectComparer{T,U}"/> class. /// </summary> /// <param name="yield">The method used to yield the member value of the compared objects.</param> /// <exception cref="ArgumentNullException"><i>yield</i> is a null reference (Nothing in Visual Basic)</exception> public ObjectComparer(YieldMember<T, U> yield) : this(yield, false, true) { }