public override bool Equals(object other) { GlobalPath otherPath = other as GlobalPath; if (otherPath == null) { return(false); } return(VolumeId.Equals(otherPath.VolumeId) && Segments.SequenceEqual(otherPath.Segments)); }
public override bool Equals(object other) { GlobalPath otherPath = other as GlobalPath; if (ReferenceEquals(otherPath, null)) // ReferenceEquals prevents infinite recursion with overloaded == operator. { return(false); } bool result = VolumeId.Equals(otherPath.VolumeId) && Segments.SequenceEqual(otherPath.Segments); return(result); }
/// <summary> /// Returns a value indicating whether this instance is equal to the specified <see cref="NzbFile"/> value. /// </summary> /// <param name="other">A <see cref="NzbFile"/> object to compare to this instance.</param> /// <returns>true if <paramref name="other" /> has the same value as this instance; otherwise, false.</returns> public bool Equals(NzbFile other) { if ((object)other == null) { return(false); } return (Poster.Equals(other.Poster) && Subject.Equals(other.Subject) && FileName.Equals(other.FileName) && Date.Equals(other.Date) && Groups.Equals(other.Groups) && Size.Equals(other.Size) && Segments.SequenceEqual(other.Segments)); }
/// <summary>Indicates whether the current object is equal to another object of the same type.</summary> /// <param name="other">An object to compare with this object.</param> /// <returns>true if the current object is equal to the <paramref name="other">other</paramref> parameter; otherwise, false.</returns> public bool Equals(JsonPointer other) { return(Segments.SequenceEqual(other.Segments) && IsUriEncoded == other.IsUriEncoded); }