/// <summary> /// Returns a value indicating whether this instance and a specified <see cref="AssemblyName"/> object represent the same value based on the given comparison mode. /// </summary> /// <param name="other">The object to compare to this instance.</param> /// <param name="comparison">One of the enumeration values that specifies how the assembly identities will be compared.</param> /// <returns><c>true</c> if the <paramref name="other"/> parameter equals the value of this instance; otherwise, <c>false</c>.</returns> public bool Equals(AssemblyName other, AssemblyIdentityComparison comparison) { if (other == null) { return(false); } return(Equals(new AssemblyIdentity(other.Name, other.Version, other.CultureInfo, other.GetPublicKeyToken()), comparison)); }
/// <summary> /// Initializes a new instance of the <see cref="AssemblyIdentityComparer"/> that respects the given comparison mode. /// </summary> /// <param name="comparison">The comparison mode.</param> public AssemblyIdentityComparer(AssemblyIdentityComparison comparison) { _comparison = comparison; }
/// <summary> /// Returns a value indicating whether this instance and a specified <see cref="AssemblyIdentity"/> object represent the same value based on the given comparison mode. /// </summary> /// <param name="other">The object to compare to this instance.</param> /// <param name="comparison">One of the enumeration values that specifies how the assembly identities will be compared.</param> /// <returns><c>true</c> if the <paramref name="other"/> parameter equals the value of this instance; otherwise, <c>false</c>.</returns> public bool Equals(AssemblyIdentity other, AssemblyIdentityComparison comparison) { return(new AssemblyIdentityComparer(comparison).Equals(this, other)); }