Exemplo n.º 1
0
            /// <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;
            }
Exemplo n.º 2
0
 /// <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)
 {
 }
Exemplo n.º 3
0
 /// <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)
 {
 }