Class MemberInfoEqualityComparer
Equality comparer for CLR member info, based on their underlying Equals method
Implements
Namespace: System.Reflection
Assembly: Nuqleon.Linq.CompilerServices.dll
Syntax
public class MemberInfoEqualityComparer : Object, IEqualityComparer<MemberInfo>
Constructors
MemberInfoEqualityComparer()
Declaration
public MemberInfoEqualityComparer()
Methods
Equals(MemberInfo, MemberInfo)
Checks whether two type members are equal.
Declaration
public virtual bool Equals(MemberInfo x, MemberInfo y)
Parameters
Type | Name | Description |
---|---|---|
System.Reflection.MemberInfo | x | First type member. |
System.Reflection.MemberInfo | y | Second type member. |
Returns
Type | Description |
---|---|
System.Boolean | True if the members are equal, false otherwise. |
EqualsConstructor(ConstructorInfo, ConstructorInfo)
Checks whether two type members are equal.
Declaration
protected virtual bool EqualsConstructor(ConstructorInfo x, ConstructorInfo y)
Parameters
Type | Name | Description |
---|---|---|
System.Reflection.ConstructorInfo | x | First type member. |
System.Reflection.ConstructorInfo | y | Second type member. |
Returns
Type | Description |
---|---|
System.Boolean | True if the members are equal, false otherwise. |
EqualsCustom(MemberInfo, MemberInfo)
Checks whether two type members are equal.
Declaration
protected virtual bool EqualsCustom(MemberInfo x, MemberInfo y)
Parameters
Type | Name | Description |
---|---|---|
System.Reflection.MemberInfo | x | First type member. |
System.Reflection.MemberInfo | y | Second type member. |
Returns
Type | Description |
---|---|
System.Boolean | True if the members are equal, false otherwise. |
EqualsEvent(EventInfo, EventInfo)
Checks whether two type members are equal.
Declaration
protected virtual bool EqualsEvent(EventInfo x, EventInfo y)
Parameters
Type | Name | Description |
---|---|---|
System.Reflection.EventInfo | x | First type member. |
System.Reflection.EventInfo | y | Second type member. |
Returns
Type | Description |
---|---|
System.Boolean | True if the members are equal, false otherwise. |
EqualsExtension(MemberInfo, MemberInfo)
Checks whether two type members are equal.
Declaration
protected virtual bool EqualsExtension(MemberInfo x, MemberInfo y)
Parameters
Type | Name | Description |
---|---|---|
System.Reflection.MemberInfo | x | First type member. |
System.Reflection.MemberInfo | y | Second type member. |
Returns
Type | Description |
---|---|
System.Boolean | True if the members are equal, false otherwise. |
EqualsField(FieldInfo, FieldInfo)
Checks whether two type members are equal.
Declaration
protected virtual bool EqualsField(FieldInfo x, FieldInfo y)
Parameters
Type | Name | Description |
---|---|---|
System.Reflection.FieldInfo | x | First type member. |
System.Reflection.FieldInfo | y | Second type member. |
Returns
Type | Description |
---|---|
System.Boolean | True if the members are equal, false otherwise. |
EqualsMethod(MethodInfo, MethodInfo)
Checks whether two type members are equal.
Declaration
protected virtual bool EqualsMethod(MethodInfo x, MethodInfo y)
Parameters
Type | Name | Description |
---|---|---|
System.Reflection.MethodInfo | x | First type member. |
System.Reflection.MethodInfo | y | Second type member. |
Returns
Type | Description |
---|---|
System.Boolean | True if the members are equal, false otherwise. |
EqualsNestedType(Type, Type)
Checks whether two type members are equal.
Declaration
protected virtual bool EqualsNestedType(Type x, Type y)
Parameters
Type | Name | Description |
---|---|---|
System.Type | x | First type member. |
System.Type | y | Second type member. |
Returns
Type | Description |
---|---|
System.Boolean | True if the members are equal, false otherwise. |
EqualsProperty(PropertyInfo, PropertyInfo)
Checks whether two type members are equal.
Declaration
protected virtual bool EqualsProperty(PropertyInfo x, PropertyInfo y)
Parameters
Type | Name | Description |
---|---|---|
System.Reflection.PropertyInfo | x | First type member. |
System.Reflection.PropertyInfo | y | Second type member. |
Returns
Type | Description |
---|---|
System.Boolean | True if the members are equal, false otherwise. |
EqualsType(TypeInfo, TypeInfo)
Checks whether two type members are equal.
Declaration
protected virtual bool EqualsType(TypeInfo x, TypeInfo y)
Parameters
Type | Name | Description |
---|---|---|
System.Reflection.TypeInfo | x | First type member. |
System.Reflection.TypeInfo | y | Second type member. |
Returns
Type | Description |
---|---|
System.Boolean | True if the members are equal, false otherwise. |
GetHashCode(MemberInfo)
Gets a hash code for the given type member.
Declaration
public virtual int GetHashCode(MemberInfo obj)
Parameters
Type | Name | Description |
---|---|---|
System.Reflection.MemberInfo | obj | Member to compute a hash code for. |
Returns
Type | Description |
---|---|
System.Int32 | Hash code for the given member. |
GetHashCodeConstructor(ConstructorInfo)
Gets a hash code for the given type member.
Declaration
protected virtual int GetHashCodeConstructor(ConstructorInfo obj)
Parameters
Type | Name | Description |
---|---|---|
System.Reflection.ConstructorInfo | obj | Member to compute a hash code for. |
Returns
Type | Description |
---|---|
System.Int32 | Hash code for the given member. |
GetHashCodeCustom(MemberInfo)
Gets a hash code for the given type member.
Declaration
protected virtual int GetHashCodeCustom(MemberInfo obj)
Parameters
Type | Name | Description |
---|---|---|
System.Reflection.MemberInfo | obj | Member to compute a hash code for. |
Returns
Type | Description |
---|---|
System.Int32 | Hash code for the given member. |
GetHashCodeEvent(EventInfo)
Gets a hash code for the given type member.
Declaration
protected virtual int GetHashCodeEvent(EventInfo obj)
Parameters
Type | Name | Description |
---|---|---|
System.Reflection.EventInfo | obj | Member to compute a hash code for. |
Returns
Type | Description |
---|---|
System.Int32 | Hash code for the given member. |
GetHashCodeExtension(MemberInfo)
Gets a hash code for the given type member.
Declaration
protected virtual int GetHashCodeExtension(MemberInfo obj)
Parameters
Type | Name | Description |
---|---|---|
System.Reflection.MemberInfo | obj | Member to compute a hash code for. |
Returns
Type | Description |
---|---|
System.Int32 | Hash code for the given member. |
GetHashCodeField(FieldInfo)
Gets a hash code for the given type member.
Declaration
protected virtual int GetHashCodeField(FieldInfo obj)
Parameters
Type | Name | Description |
---|---|---|
System.Reflection.FieldInfo | obj | Member to compute a hash code for. |
Returns
Type | Description |
---|---|
System.Int32 | Hash code for the given member. |
GetHashCodeMethod(MethodInfo)
Gets a hash code for the given type member.
Declaration
protected virtual int GetHashCodeMethod(MethodInfo obj)
Parameters
Type | Name | Description |
---|---|---|
System.Reflection.MethodInfo | obj | Member to compute a hash code for. |
Returns
Type | Description |
---|---|
System.Int32 | Hash code for the given member. |
GetHashCodeNestedType(Type)
Gets a hash code for the given type member.
Declaration
protected virtual int GetHashCodeNestedType(Type obj)
Parameters
Type | Name | Description |
---|---|---|
System.Type | obj | Member to compute a hash code for. |
Returns
Type | Description |
---|---|
System.Int32 | Hash code for the given member. |
GetHashCodeProperty(PropertyInfo)
Gets a hash code for the given type member.
Declaration
protected virtual int GetHashCodeProperty(PropertyInfo obj)
Parameters
Type | Name | Description |
---|---|---|
System.Reflection.PropertyInfo | obj | Member to compute a hash code for. |
Returns
Type | Description |
---|---|
System.Int32 | Hash code for the given member. |
GetHashCodeType(TypeInfo)
Gets a hash code for the given type member.
Declaration
protected virtual int GetHashCodeType(TypeInfo obj)
Parameters
Type | Name | Description |
---|---|---|
System.Reflection.TypeInfo | obj | Member to compute a hash code for. |
Returns
Type | Description |
---|---|
System.Int32 | Hash code for the given member. |
ResolveConstructor(Type, ConstructorInfo)
Attempts to resolve a constructor on the target type.
Declaration
protected virtual ConstructorInfo ResolveConstructor(Type targetType, ConstructorInfo constructor)
Parameters
Type | Name | Description |
---|---|---|
System.Type | targetType | The target type. |
System.Reflection.ConstructorInfo | constructor | The constructor. |
Returns
Type | Description |
---|---|
System.Reflection.ConstructorInfo | The resolved constructor if found, null otherwise. |
ResolveCustom(Type, MemberInfo)
Attempts to resolve a custom member on the target type.
Declaration
protected virtual MemberInfo ResolveCustom(Type targetType, MemberInfo member)
Parameters
Type | Name | Description |
---|---|---|
System.Type | targetType | The target type. |
System.Reflection.MemberInfo | member | The member. |
Returns
Type | Description |
---|---|
System.Reflection.MemberInfo | The resolved member if found, null otherwise. |
ResolveEvent(Type, EventInfo)
Attempts to resolve an event on the target type.
Declaration
protected virtual EventInfo ResolveEvent(Type targetType, EventInfo eventInfo)
Parameters
Type | Name | Description |
---|---|---|
System.Type | targetType | The target type. |
System.Reflection.EventInfo | eventInfo | The event. |
Returns
Type | Description |
---|---|
System.Reflection.EventInfo | The resolved event if found, null otherwise. |
ResolveExtension(Type, MemberInfo)
Attempts to resolve an extension member on the target type.
Declaration
protected virtual MemberInfo ResolveExtension(Type targetType, MemberInfo member)
Parameters
Type | Name | Description |
---|---|---|
System.Type | targetType | The target type. |
System.Reflection.MemberInfo | member | The member. |
Returns
Type | Description |
---|---|
System.Reflection.MemberInfo | The resolved extension member if found, null otherwise. |
ResolveField(Type, FieldInfo)
Attempts to resolve a field on the target type.
Declaration
protected virtual FieldInfo ResolveField(Type targetType, FieldInfo field)
Parameters
Type | Name | Description |
---|---|---|
System.Type | targetType | The target type. |
System.Reflection.FieldInfo | field | The field. |
Returns
Type | Description |
---|---|
System.Reflection.FieldInfo | The resolved field if found, null otherwise. |
ResolveMember(Type, MemberInfo)
Resolves the member to compare against on the target type.
Declaration
public MemberInfo ResolveMember(Type targetType, MemberInfo member)
Parameters
Type | Name | Description |
---|---|---|
System.Type | targetType | The type to find a comparable member on. |
System.Reflection.MemberInfo | member | The member to lookup on the target type. |
Returns
Type | Description |
---|---|
System.Reflection.MemberInfo | The comparable member on the target type. |
ResolveMethod(Type, MethodInfo)
Attempts to resolve a method on the target type.
Declaration
protected virtual MethodInfo ResolveMethod(Type targetType, MethodInfo method)
Parameters
Type | Name | Description |
---|---|---|
System.Type | targetType | The target type. |
System.Reflection.MethodInfo | method | The method. |
Returns
Type | Description |
---|---|
System.Reflection.MethodInfo | The resolved method if found, null otherwise. |
ResolveNestedType(Type, Type)
Attempts to resolve a nested type on the target type.
Declaration
protected virtual Type ResolveNestedType(Type targetType, Type nestedType)
Parameters
Type | Name | Description |
---|---|---|
System.Type | targetType | The target type. |
System.Type | nestedType | The nested type. |
Returns
Type | Description |
---|---|
System.Type | The resolved nested type if found, null otherwise. |
ResolveProperty(Type, PropertyInfo)
Attempts to resolve a property on the target type.
Declaration
protected virtual PropertyInfo ResolveProperty(Type targetType, PropertyInfo propertyInfo)
Parameters
Type | Name | Description |
---|---|---|
System.Type | targetType | The target type. |
System.Reflection.PropertyInfo | propertyInfo | The property. |
Returns
Type | Description |
---|---|
System.Reflection.PropertyInfo | The resolved property if found, null otherwise. |
ResolveTypeInfo(Type, TypeInfo)
Attempts to resolve type info on the target type.
Declaration
protected virtual TypeInfo ResolveTypeInfo(Type targetType, TypeInfo typeInfo)
Parameters
Type | Name | Description |
---|---|---|
System.Type | targetType | The target type. |
System.Reflection.TypeInfo | typeInfo | The type info. |
Returns
Type | Description |
---|---|
System.Reflection.TypeInfo | The resolved type info if found, null otherwise. |