/// <summary> /// Compare the user entered data against the passed instance for similarity. /// </summary> /// <param name="obj">The object to compare this instance against.</param> /// <returns> /// True if instance matches user data, otherwise false. /// </returns> public override bool IsEquivalentTo(object obj) { var repository = obj as GedcomRepositoryCitation; if (repository == null) { return(false); } if (!GedcomGenericListComparer.CompareLists(CallNumbers, repository.CallNumbers)) { return(false); } if (!GedcomGenericListComparer.CompareLists(MediaTypes, repository.MediaTypes)) { return(false); } if (!GedcomGenericListComparer.CompareLists(OtherMediaTypes, repository.OtherMediaTypes)) { return(false); } if (!Equals(Repository, repository.Repository)) { return(false); } return(true); }
/// <summary> /// Compare the user entered data against the passed instance for similarity. /// </summary> /// <param name="obj">The object to compare this instance against.</param> /// <returns> /// True if instance matches user data, otherwise false. /// </returns> public override bool IsEquivalentTo(object obj) { var media = obj as GedcomMultimediaRecord; if (media == null) { return(false); } if (!Equals(ChangeDate, media.ChangeDate)) { return(false); } if (!GedcomGenericListComparer.CompareLists(Files, media.Files)) { return(false); } if (!Equals(Title, media.Title)) { return(false); } return(true); }
/// <summary> /// Compare the user entered data against the passed instance for similarity. /// </summary> /// <param name="obj">The object to compare this instance against.</param> /// <returns> /// True if instance matches user data, otherwise false. /// </returns> public override bool IsEquivalentTo(object obj) { var submitter = obj as GedcomSubmitterRecord; if (submitter == null) { return(false); } if (!Equals(Address, submitter.Address)) { return(false); } if (!GedcomGenericListComparer.CompareLists(LanguagePreferences, submitter.LanguagePreferences)) { return(false); } if (!Equals(Name, submitter.Name)) { return(false); } if (!Equals(RegisteredRFN, submitter.RegisteredRFN)) { return(false); } return(true); }
/// <summary> /// Compares the inheriting instance user entered data against the passed GedcomRecord. /// If that matches, will then compare the common elements of the passed GedcomRecord /// against this instance (Source etc. which are common to all inheritors). /// </summary> /// <param name="obj">The GedcomRecord to compare against.</param> /// <returns>True if the core base properties match, otherwise False.</returns> public bool Equals(GedcomRecord obj) { if (obj == null || GetType() != obj.GetType()) { return(false); } // Ask the inheriting object if its user entered data is the same. if (!IsEquivalentTo(obj)) { return(false); } var record = obj as GedcomRecord; if (!Equals(ChangeDate, record.ChangeDate)) { return(false); } if (!Equals(Level, record.Level)) { return(false); } if (!Equals(RestrictionNotice, record.RestrictionNotice)) { return(false); } if (!GedcomGenericListComparer.CompareGedcomRecordLists(Sources, record.Sources)) { return(false); } if (!GedcomGenericListComparer.CompareLists(Multimedia, record.Multimedia)) { return(false); } /* TODO: Notes are hard work, we need to do lookups by xref instead of just having a list of GedcomNote records attached. Need to fix this as a pain to test and use as well. * //if (!GedcomGenericListComparer.CompareLists(Notes, record.Notes)) * //{ * // return false; * //} */ return(true); }
/// <summary> /// Compare the user entered data against the passed instance for similarity. /// </summary> /// <param name="obj">The object to compare this instance against.</param> /// <returns> /// True if instance matches user data, otherwise false. /// </returns> public override bool IsEquivalentTo(object obj) { var place = obj as GedcomPlace; if (place == null) { return(false); } if (!Equals(ChangeDate, place.ChangeDate)) { return(false); } if (!Equals(Form, place.Form)) { return(false); } if (!Equals(Latitude, place.Latitude)) { return(false); } if (!Equals(Longitude, place.Longitude)) { return(false); } if (!Equals(Name, place.Name)) { return(false); } if (!GedcomGenericListComparer.CompareLists(PhoneticVariations, place.PhoneticVariations)) { return(false); } if (!GedcomGenericListComparer.CompareLists(RomanizedVariations, place.RomanizedVariations)) { return(false); } return(true); }
/// <summary> /// Compare the user entered data against the passed instance for similarity. /// </summary> /// <param name="obj">The object to compare this instance against.</param> /// <returns> /// True if instance matches user data, otherwise false. /// </returns> public override bool IsEquivalentTo(object obj) { var source = obj as GedcomSourceRecord; if (source == null) { return(false); } if (!Equals(Agency, source.Agency)) { return(false); } if (!GedcomGenericListComparer.CompareGedcomRecordLists(Citations, source.Citations)) { return(false); } if (!GedcomGenericListComparer.CompareLists(DataNotes, source.DataNotes)) { return(false); } if (!GedcomGenericListComparer.CompareLists(EventsRecorded, source.EventsRecorded)) { return(false); } if (!Equals(FiledBy, source.FiledBy)) { return(false); } if (!Equals(Originator, source.Originator)) { return(false); } if (!Equals(Convert.ToString(OriginatorText), Convert.ToString(source.OriginatorText))) { return(false); } if (!Equals(PublicationFacts, source.PublicationFacts)) { return(false); } if (!Equals(Convert.ToString(PublicationText), Convert.ToString(source.PublicationText))) { return(false); } if (!GedcomGenericListComparer.CompareGedcomRecordLists(RepositoryCitations, source.RepositoryCitations)) { return(false); } if (!Equals(Text, source.Text)) { return(false); } if (!Equals(Convert.ToString(TextText), Convert.ToString(source.TextText))) { return(false); } if (!Equals(Title, source.Title)) { return(false); } if (!Equals(Convert.ToString(TitleText), Convert.ToString(source.TitleText))) { return(false); } return(true); }