/// <summary> /// Compares two properties /// </summary> /// <param name="a">First property</param> /// <param name="b">Second property</param> /// <returns></returns> public bool Equals(DmdPropertyInfo a, DmdPropertyInfo b) { if ((object)a == b) { return(true); } if ((object)a == null || (object)b == null) { return(false); } return(MemberNameEquals(a.Name, b.Name) && Equals(a.GetMethodSignature(), b.GetMethodSignature()) && (!CompareDeclaringType || Equals(a.DeclaringType, b.DeclaringType))); }
/// <summary> /// Gets the hash code of a property /// </summary> /// <param name="a">Property</param> /// <returns></returns> public int GetHashCode(DmdPropertyInfo a) { if ((object)a == null) { return(0); } int hc = MemberNameGetHashCode(a.Name); hc ^= GetHashCode(a.GetMethodSignature()); if (CompareDeclaringType) { hc ^= GetHashCode(a.DeclaringType); } return(hc); }
string FormatCore(DmdPropertyInfo property) { Write(property); return(writer.ToString()); }
void Write(DmdPropertyInfo property) => WriteMethod(property.Name, property.GetMethodSignature(), genericArguments: null, isMethod: false);
public static string Format(DmdPropertyInfo property, bool serializable = false) { using (var formatter = new DmdMemberFormatter(serializable ? GlobalFlags.Serializable : GlobalFlags.None)) return(formatter.FormatCore(property)); }