/// <summary> /// Determines whether this instance of <see cref="IPermission"/> and /// another specified <see cref="IPermission"/> refers to the same /// permission. /// </summary> /// <param name="perm"> /// A <see cref="IPermission"/> object. /// </param> /// <returns> /// <c>true</c> if the permission's name and actions list of the /// <paramref name="perm"/> object is the same as this instance; /// otherwise, <c>false</c>. /// </returns> /// <remarks> /// <para> /// This class uses the permission name and its action list when comparing /// permissions. This method performs an ordinal (case-insensitive and /// culture-insensitive) comparison. /// </para> /// </remarks> public virtual bool Equals(IPermission perm) { if ((object)perm == null) { return(false); } return(name_ == perm.Name && GetHashCode() == perm.GetHashCode()); }
/// <summary> /// Determines whether this instance of <see cref="IPermission"/> and /// another specified <see cref="IPermission"/> refers to the same /// permission. /// </summary> /// <param name="perm"> /// A <see cref="IPermission"/> object. /// </param> /// <returns> /// <c>true</c> if the permission's name and actions list of the /// <paramref name="perm"/> object is the same as this instance; /// otherwise, <c>false</c>. /// </returns> /// <remarks> /// <para> /// This class uses the permission name and its action list when comparing /// permissions. This method performs an ordinal (case-insensitive and /// culture-insensitive) comparison. /// </para> /// </remarks> public virtual bool Equals(IPermission perm) { if ((object) perm == null) { return false; } return name_ == perm.Name && GetHashCode() == perm.GetHashCode(); }