public override string ToString() { if (SourceType == SourceType.WebSite) { var result = new StringBuilder(); result.Append(Site).Append(" ").Append(ElectronicSourceText); if (PublisherCity != null || PublisherYear != null) { result.Append(". – "); if (PublisherCity != null) { result.Append(PublisherCity); if (PublisherYear != null) { result.Append(", "); } } if (PublisherYear != null) { result.Append(PublisherYear); } } result.Append(". – ").Append(ModeOfAccess); result.Append(". – ").Append(DateOfAccess); result.Append("."); return(result.ToString()); } else { var result = new StringBuilder(); if (Authors1.Any()) { result.Append(Authors1.First().ToString("r")).Append(" "); } result.Append(Title); if (Authors2.Any()) { result.Append(" / ").Append(string.Join(", ", Authors2)); } result.Append(" // ").Append(Site).Append(" ").Append(ElectronicSourceText); if (PublisherYear != null) { result.Append(". – ").Append(PublisherYear); } if (No != null) { result.Append(". – ").Append(No); } result.Append(". – ").Append(ModeOfAccess); result.Append(". – ").Append(DateOfAccess); result.Append("."); return(result.ToString()); } }
public override string ToString() { var result = new StringBuilder(); if (Authors1.Any()) { result.Append(Authors1.First().ToString("r")).Append(" "); } result.Append(Title).Append(" / "); result.Append(string.Join(", ", Authors2)); if (HasOtherAuthors) { result.Append(Lang == "by" ? " [і інш.]" : " [и др.]"); // TODO. } if (Collectivity != null) { result.Append(Collectivity); } if (Editor != null) { if (Collectivity != null || Authors2.Any()) { result.Append(" ; "); } result.Append(EditorText).Append(" ").Append(Editor); if (EditorTitle != null) { result.Append(" (").Append(EditorTitle).Append(")"); } if (HasOtherEditors) { result.Append(Lang == "by"? " [і інш.]" : " [и др.]"); } } if (Edition != null) { result.Append(". – ").Append(Edition).Append("-е ").Append(Lang == "by"? "выд." : "изд."); } result.Append(". – ").Append(PublisherCity).Append(" : ").Append(PublisherName).Append(", ").Append(PublisherYear); if (PublisherYearEnd != null) { result.Append("–").Append(PublisherYearEnd); } if (Pages != null) { result.Append(". – ").Append(Pages).Append(" с."); } return(result.Replace("..", ".").ToString()); }
protected bool Equals(Book other) => (Authors1?.SequenceEqual(other.Authors1) ?? true) && string.Equals(Title, other.Title) && (Authors2?.SequenceEqual(other.Authors2) ?? true) && HasOtherAuthors == other.HasOtherAuthors && Collectivity == other.Collectivity && Equals(Editor, other.Editor) && HasOtherEditors == other.HasOtherEditors && string.Equals(EditorText, other.EditorText) && Edition == other.Edition && string.Equals(PublisherCity, other.PublisherCity) && string.Equals(PublisherName, other.PublisherName) && PublisherYear == other.PublisherYear && Pages == other.Pages && PageStart == other.PageStart && PageEnd == other.PageEnd && Number == other.Number && Volume == other.Volume && PublisherYearEnd == other.PublisherYearEnd;
public override int GetHashCode() { unchecked { var hashCode = (Authors1 != null? Authors1.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (Title != null? Title.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (Authors2 != null? Authors2.GetHashCode() : 0); hashCode = (hashCode * 397) ^ HasOtherAuthors.GetHashCode(); hashCode = (hashCode * 397) ^ (Editor != null? Editor.GetHashCode() : 0); hashCode = (hashCode * 397) ^ HasOtherEditors.GetHashCode(); hashCode = (hashCode * 397) ^ Edition.GetHashCode(); hashCode = (hashCode * 397) ^ (PublisherCity != null? PublisherCity.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (PublisherName != null? PublisherName.GetHashCode() : 0); hashCode = (hashCode * 397) ^ PublisherYear.GetHashCode(); hashCode = (hashCode * 397) ^ Pages.GetHashCode(); hashCode = (hashCode * 397) ^ PageStart.GetHashCode(); hashCode = (hashCode * 397) ^ PageEnd.GetHashCode(); hashCode = (hashCode * 397) ^ Number.GetHashCode(); return(hashCode); } }