Exemplo n.º 1
0
        /// <summary>确定指定对象中的 URL 是否等效于包含在当前 <see cref="T:System.Security.Policy.UrlMembershipCondition" /> 中的 URL。</summary>
        /// <returns>如果指定对象中的 URL 等效于包含在当前 <see cref="T:System.Security.Policy.UrlMembershipCondition" /> 中的 URL,则为 true;否则为 false。</returns>
        /// <param name="o">与当前的 <see cref="T:System.Security.Policy.UrlMembershipCondition" /> 比较的对象。</param>
        /// <exception cref="T:System.ArgumentNullException">当前对象或指定对象的 <see cref="P:System.Security.Policy.UrlMembershipCondition.Url" /> 属性是 null。</exception>
        public override bool Equals(object o)
        {
            UrlMembershipCondition membershipCondition = o as UrlMembershipCondition;

            if (membershipCondition != null)
            {
                if (this.m_url == null && this.m_element != null)
                {
                    this.ParseURL();
                }
                if (membershipCondition.m_url == null && membershipCondition.m_element != null)
                {
                    membershipCondition.ParseURL();
                }
                if (object.Equals((object)this.m_url, (object)membershipCondition.m_url))
                {
                    return(true);
                }
            }
            return(false);
        }
        public override bool Equals(object o)
        {
            UrlMembershipCondition condition = o as UrlMembershipCondition;

            if (condition != null)
            {
                if ((this.m_url == null) && (this.m_element != null))
                {
                    this.ParseURL();
                }
                if ((condition.m_url == null) && (condition.m_element != null))
                {
                    condition.ParseURL();
                }
                if (object.Equals(this.m_url, condition.m_url))
                {
                    return(true);
                }
            }
            return(false);
        }
Exemplo n.º 3
0
        public override bool Equals(Object o)
        {
            UrlMembershipCondition that = (o as UrlMembershipCondition);

            if (that != null)
            {
                if (this.m_url == null && this.m_element != null)
                {
                    this.ParseURL();
                }
                if (that.m_url == null && that.m_element != null)
                {
                    that.ParseURL();
                }

                if (Equals(this.m_url, that.m_url))
                {
                    return(true);
                }
            }
            return(false);
        }