Exemplo n.º 1
0
        /// <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)));
        }
Exemplo n.º 2
0
        /// <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);
        }
Exemplo n.º 3
0
 void Write(DmdPropertyInfo property) => WriteMethod(property.Name, property.GetMethodSignature(), genericArguments: null, isMethod: false);