Пример #1
0
        public override int GetHashCode()
        {
            int hash = 0;

            hash += DeclaringTypes.GetHashCode();
            hash += EventHandlerPropertyName.GetHashCode();
            hash += EventHandler.GetHashCode();
            hash += EventArgsType.GetHashCode();
            hash += Description.GetHashCode();
            return(hash);
        }
Пример #2
0
        public bool DescribesProperty(MemberInfo property)
        {
            if (DeclaringTypes == null || PropertyName == null)
            {
                return(false);
            }
            if (PropertyName != property.Name)
            {
                return(false);
            }

            var declaringType = property.DeclaringType;

            do
            {
                if (DeclaringTypes.Contains(declaringType))
                {
                    return(true);
                }
                declaringType = declaringType.BaseType;
            }while (declaringType != null);

            return(false);
        }