public override bool Equals(object o) { SiteMembershipCondition condition = o as SiteMembershipCondition; if (condition != null) { if ((this.m_site == null) && (this.m_element != null)) { this.ParseSite(); } if ((condition.m_site == null) && (condition.m_element != null)) { condition.ParseSite(); } if (object.Equals(this.m_site, condition.m_site)) { return(true); } } return(false); }
/// <summary>确定指定 <see cref="T:System.Security.Policy.SiteMembershipCondition" /> 对象中的站点是否等效于包含在当前 <see cref="T:System.Security.Policy.SiteMembershipCondition" /> 中的站点。</summary> /// <returns>如果指定 <see cref="T:System.Security.Policy.SiteMembershipCondition" /> 对象中的站点等效于包含在当前 <see cref="T:System.Security.Policy.SiteMembershipCondition" /> 中的站点,则为 true;否则,为 false。</returns> /// <param name="o">要与当前 <see cref="T:System.Security.Policy.SiteMembershipCondition" /> 进行比较的 <see cref="T:System.Security.Policy.SiteMembershipCondition" /> 对象。</param> /// <exception cref="T:System.ArgumentException">当前对象或指定对象的 <see cref="P:System.Security.Policy.SiteMembershipCondition.Site" /> 属性为 null。</exception> public override bool Equals(object o) { SiteMembershipCondition membershipCondition = o as SiteMembershipCondition; if (membershipCondition != null) { if (this.m_site == null && this.m_element != null) { this.ParseSite(); } if (membershipCondition.m_site == null && membershipCondition.m_element != null) { membershipCondition.ParseSite(); } if (object.Equals((object)this.m_site, (object)membershipCondition.m_site)) { return(true); } } return(false); }
public override bool Equals(Object o) { SiteMembershipCondition that = (o as SiteMembershipCondition); if (that != null) { if (this.m_site == null && this.m_element != null) { this.ParseSite(); } if (that.m_site == null && that.m_element != null) { that.ParseSite(); } if (Equals(this.m_site, that.m_site)) { return(true); } } return(false); }