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

            if (membershipCondition != null)
            {
                if (this.m_zone == SecurityZone.NoZone && this.m_element != null)
                {
                    this.ParseZone();
                }
                if (membershipCondition.m_zone == SecurityZone.NoZone && membershipCondition.m_element != null)
                {
                    membershipCondition.ParseZone();
                }
                if (this.m_zone == membershipCondition.m_zone)
                {
                    return(true);
                }
            }
            return(false);
        }
Esempio n. 2
0
        public override bool Equals(object o)
        {
            ZoneMembershipCondition condition = o as ZoneMembershipCondition;

            if (condition != null)
            {
                if ((this.m_zone == System.Security.SecurityZone.NoZone) && (this.m_element != null))
                {
                    this.ParseZone();
                }
                if ((condition.m_zone == System.Security.SecurityZone.NoZone) && (condition.m_element != null))
                {
                    condition.ParseZone();
                }
                if (this.m_zone == condition.m_zone)
                {
                    return(true);
                }
            }
            return(false);
        }
Esempio n. 3
0
        public override bool Equals(Object o)
        {
            ZoneMembershipCondition that = (o as ZoneMembershipCondition);

            if (that != null)
            {
                if (this.m_zone == SecurityZone.NoZone && this.m_element != null)
                {
                    this.ParseZone();
                }
                if (that.m_zone == SecurityZone.NoZone && that.m_element != null)
                {
                    that.ParseZone();
                }

                if (this.m_zone == that.m_zone)
                {
                    return(true);
                }
            }
            return(false);
        }