Class MemberComparer
Provides custom equality comparison for requests of a property and field.
Inheritance
Inherited Members
Namespace: SemanticComparison
Assembly: SemanticComparison.dll
Syntax
public class MemberComparer : IMemberComparer, IEqualityComparer
Constructors
| Improve this Doc View SourceMemberComparer(IEqualityComparer)
Initializes a new instance of the MemberComparer class with the supplied System.Collections.IEqualityComparer to support the comparison of properties and fields.
Declaration
public MemberComparer(IEqualityComparer comparer)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.IEqualityComparer | comparer | The supplied System.Collections.IEqualityComparer. |
MemberComparer(IEqualityComparer, ISpecification<PropertyInfo>, ISpecification<FieldInfo>)
Initializes a new instance of the MemberComparer class with the supplied System.Collections.IEqualityComparer, ISpecification<T>, and ISpecification<T> to support the comparison of properties and fields.
Declaration
public MemberComparer(IEqualityComparer comparer, ISpecification<PropertyInfo> propertySpecification, ISpecification<FieldInfo> fieldSpecification)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.IEqualityComparer | comparer | The supplied System.Collections.IEqualityComparer. |
ISpecification<System.Reflection.PropertyInfo> | propertySpecification | The supplied Specification used to control whether or not a property should be compared. |
ISpecification<System.Reflection.FieldInfo> | fieldSpecification | The supplied Specification used to control whether or not a field should be compared. |
Properties
| Improve this Doc View SourceComparer
Gets the supplied System.Collections.IEqualityComparer.
Declaration
public IEqualityComparer Comparer { get; }
Property Value
Type | Description |
---|---|
System.Collections.IEqualityComparer | The supplied System.Collections.IEqualityComparer. |
FieldSpecification
Gets the supplied Specification used to control whether or not a field should be compared.
Declaration
public ISpecification<FieldInfo> FieldSpecification { get; }
Property Value
Type | Description |
---|---|
ISpecification<System.Reflection.FieldInfo> | The supplied Specification used to control whether or not a field should be compared. |
PropertySpecification
Gets the supplied Specification used to control whether or not a property should be compared.
Declaration
public ISpecification<PropertyInfo> PropertySpecification { get; }
Property Value
Type | Description |
---|---|
ISpecification<System.Reflection.PropertyInfo> | The supplied Specification used to control whether or not a property should be compared. |
Methods
| Improve this Doc View SourceEquals(Object, Object)
Determines whether the specified System.Object is equal to this instance.
Declaration
public bool Equals(object x, object y)
Parameters
Type | Name | Description |
---|---|---|
System.Object | x | The System.Object to compare with this instance. |
System.Object | y | The y. |
Returns
Type | Description |
---|---|
System.Boolean |
|
Remarks
x
and y
are considered
equal if the supplied System.Collections.IEqualityComparer's Equals
method returns true.
GetHashCode(Object)
Returns a hash code for this instance.
Declaration
public int GetHashCode(object obj)
Parameters
Type | Name | Description |
---|---|---|
System.Object | obj | The obj. |
Returns
Type | Description |
---|---|
System.Int32 | A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table. |
IsSatisfiedBy(FieldInfo)
Evaluates a request for comparison of a field.
Declaration
public bool IsSatisfiedBy(FieldInfo request)
Parameters
Type | Name | Description |
---|---|---|
System.Reflection.FieldInfo | request | The request for comparison of a field. |
Returns
Type | Description |
---|---|
System.Boolean | true. |
IsSatisfiedBy(PropertyInfo)
Evaluates a request for comparison of a property.
Declaration
public bool IsSatisfiedBy(PropertyInfo request)
Parameters
Type | Name | Description |
---|---|---|
System.Reflection.PropertyInfo | request | The request for comparison of a property. |
Returns
Type | Description |
---|---|
System.Boolean | true. |