public override int GetHashCode() { unchecked { var hashCode = (Isbn != null ? Isbn.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (Authors != null ? Authors.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (PubCity != null ? PubCity.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (PubName != null ? PubName.GetHashCode() : 0); hashCode = (hashCode * 397) ^ PubYear.GetHashCode(); hashCode = (hashCode * 397) ^ (Name != null ? Name.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (Note != null ? Note.GetHashCode() : 0); hashCode = (hashCode * 397) ^ CountPages; return(hashCode); } }
public override int GetHashCode() { unchecked { var hashCode = Number; hashCode = (hashCode * 397) ^ (Issn != null ? Issn.GetHashCode() : 0); hashCode = (hashCode * 397) ^ Date.GetHashCode(); hashCode = (hashCode * 397) ^ (PubCity != null ? PubCity.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (PubName != null ? PubName.GetHashCode() : 0); hashCode = (hashCode * 397) ^ PubYear.GetHashCode(); hashCode = (hashCode * 397) ^ (Name != null ? Name.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (Note != null ? Note.GetHashCode() : 0); hashCode = (hashCode * 397) ^ CountPages; return(hashCode); } }
public int CompareTo(object obj) { var newObj = obj as Patent; if (ReferenceEquals(this, newObj)) { return(0); } else if (newObj == null) { return(1); } var cmp = DateTime.Compare(PubDate, newObj.PubDate); if (cmp != 0) { return(cmp); } cmp = Inventors.OrderBy(t => t).SequenceEqual(newObj.Inventors.OrderBy(t => t)) ? 1 : 0; if (cmp != 0) { return(cmp); } cmp = DateTime.Compare(AppDate, newObj.AppDate); if (cmp != 0) { return(cmp); } cmp = string.Compare(Country, newObj.Country, StringComparison.Ordinal); if (cmp != 0) { return(cmp); } cmp = string.Compare(Name, newObj.Name, StringComparison.Ordinal); if (cmp != 0) { return(cmp); } cmp = RegNumber.CompareTo(newObj.RegNumber); if (cmp != 0) { return(cmp); } cmp = string.Compare(Note, newObj.Note, StringComparison.Ordinal); if (cmp != 0) { return(cmp); } cmp = CountPages.CompareTo(newObj.CountPages); if (cmp != 0) { return(cmp); } cmp = Price.CompareTo(newObj.Price); if (cmp != 0) { return(cmp); } cmp = PubYear.CompareTo(newObj.PubYear); if (cmp != 0) { return(cmp); } return(0); }
public int CompareTo(object obj) { var newObj = obj as Book; if (ReferenceEquals(this, newObj)) { return(0); } else if (newObj == null) { return(1); } var cmp = string.Compare(Isbn, newObj.Isbn, StringComparison.Ordinal); if (cmp != 0) { return(cmp); } cmp = Authors.OrderBy(t => t).SequenceEqual(newObj.Authors.OrderBy(t => t)) ? 1 : 0; if (cmp != 0) { return(cmp); } cmp = string.Compare(Name, newObj.Name, StringComparison.Ordinal); if (cmp != 0) { return(cmp); } cmp = string.Compare(PubCity, newObj.PubCity, StringComparison.Ordinal); if (cmp != 0) { return(cmp); } cmp = string.Compare(PubName, newObj.PubName, StringComparison.Ordinal); if (cmp != 0) { return(cmp); } cmp = PubYear.CompareTo(newObj.PubYear); if (cmp != 0) { return(cmp); } cmp = string.Compare(Note, newObj.Note, StringComparison.Ordinal); if (cmp != 0) { return(cmp); } cmp = CountPages.CompareTo(newObj.CountPages); if (cmp != 0) { return(cmp); } cmp = Price.CompareTo(newObj.Price); if (cmp != 0) { return(cmp); } cmp = CountCopies.CompareTo(newObj.CountCopies); if (cmp != 0) { return(cmp); } return(0); }
protected bool Equals(Book other) { return(string.Equals(Isbn, other.Isbn) && Equals(Authors, other.Authors) && string.Equals(PubCity, other.PubCity) && string.Equals(PubName, other.PubName) && PubYear.Equals(other.PubYear) && string.Equals(Name, other.Name) && string.Equals(Note, other.Note) && CountPages == other.CountPages); }
public int CompareTo(object obj) { var newObj = obj as Paper; if (ReferenceEquals(this, newObj)) { return(0); } else if (newObj == null) { return(1); } var cmp = string.Compare(Issn, newObj.Issn, StringComparison.Ordinal); if (cmp != 0) { return(cmp); } cmp = DateTime.Compare(Date, newObj.Date); if (cmp != 0) { return(cmp); } cmp = string.Compare(Name, newObj.Name, StringComparison.Ordinal); if (cmp != 0) { return(cmp); } cmp = string.Compare(PubCity, newObj.PubCity, StringComparison.Ordinal); if (cmp != 0) { return(cmp); } cmp = string.Compare(PubName, newObj.PubName, StringComparison.Ordinal); if (cmp != 0) { return(cmp); } cmp = Number.CompareTo(newObj.Number); if (cmp != 0) { return(cmp); } cmp = CountCopies.CompareTo(newObj.CountCopies); if (cmp != 0) { return(cmp); } cmp = string.Compare(Note, newObj.Note, StringComparison.Ordinal); if (cmp != 0) { return(cmp); } cmp = CountPages.CompareTo(newObj.CountPages); if (cmp != 0) { return(cmp); } cmp = Price.CompareTo(newObj.Price); if (cmp != 0) { return(cmp); } cmp = PubYear.CompareTo(newObj.PubYear); if (cmp != 0) { return(cmp); } return(0); }
protected bool Equals(Paper other) { return(Number == other.Number && string.Equals(Issn, other.Issn) && Date.Equals(other.Date) && string.Equals(PubCity, other.PubCity) && string.Equals(PubName, other.PubName) && PubYear.Equals(other.PubYear) && string.Equals(Name, other.Name) && string.Equals(Note, other.Note) && CountPages == other.CountPages); }