///////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////// /// <summary>compares 2 source objects</summary> /// <param name="theOne">the One source</param> /// <param name="theOther">the Other source</param> /// <returns>true if identical </returns> ////////////////////////////////////////////////////////////////////// public static bool IsSourceIdentical(AtomSource theOne, AtomSource theOther) { Tracing.TraceInfo("Comparing source objects"); if (theOne == null && theOther == null) { return(true); } if (!ObjectModelHelper.IsBaseIdentical(theOne, theOther)) { return(false); } Tracing.TraceInfo("Source: comparing Authors collections"); if (!ObjectModelHelper.IsPersonCollectionIdentical(theOne.Authors, theOther.Authors)) { return(false); } Tracing.TraceInfo("Source: comparing Contributors collections"); if (!ObjectModelHelper.IsPersonCollectionIdentical(theOne.Contributors, theOther.Contributors)) { return(false); } Tracing.TraceInfo("Source: comparing categories collections"); if (!ObjectModelHelper.IsCategoryCollectionIdentical(theOne.Categories, theOther.Categories)) { return(false); } Tracing.TraceInfo("Source: comparing links collections"); if (!ObjectModelHelper.IsLinkCollectionIdentical(theOne.Links, theOther.Links)) { return(false); } if (!ObjectModelHelper.IsTextConstructIdentical(theOne.Title, theOther.Title)) { return(false); } if (!ObjectModelHelper.IsTextConstructIdentical(theOne.Rights, theOther.Rights)) { return(false); } if (!ObjectModelHelper.IsTextConstructIdentical(theOne.Subtitle, theOther.Subtitle)) { return(false); } if (!ObjectModelHelper.IsBaseLinkIdentical(theOne.Id, theOther.Id)) { return(false); } if (!ObjectModelHelper.IsGeneratorIdentical(theOne.Generator, theOther.Generator)) { return(false); } if (!ObjectModelHelper.IsBaseLinkIdentical(theOne.Icon, theOther.Icon)) { return(false); } if (!ObjectModelHelper.IsBaseLinkIdentical(theOne.Logo, theOther.Logo)) { return(false); } return(true); }
///////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////// /// <summary>compares two atomEntrys to see if they are identical objects</summary> /// <param name="theOne">the first AtomEntry </param> /// <param name="theOther">the other AtomEntry to compare with </param> /// <returns>true if equal </returns> ////////////////////////////////////////////////////////////////////// public static bool IsEntryIdentical(AtomEntry theOne, AtomEntry theOther) { Tracing.TraceMsg("Entering IsEntryIdentical"); if (theOne == null || theOther == null) { return(theOne == theOther); } Tracing.TraceMsg("Comparing AuthorCollection"); if (!ObjectModelHelper.IsPersonCollectionIdentical(theOne.Authors, theOther.Authors)) { return(false); } Tracing.TraceMsg("Comparing ContributorCollection"); if (!ObjectModelHelper.IsPersonCollectionIdentical(theOne.Contributors, theOther.Contributors)) { return(false); } Tracing.TraceMsg("Comparing CategoryCollection"); if (!ObjectModelHelper.IsCategoryCollectionIdentical(theOne.Categories, theOther.Categories)) { return(false); } Tracing.TraceMsg("Comparing LinkCollection"); if (!ObjectModelHelper.IsLinkCollectionIdentical(theOne.Links, theOther.Links)) { return(false); } Tracing.TraceMsg("Comparing Content"); if (!ObjectModelHelper.IsContentIdentical(theOne.Content, theOther.Content)) { return(false); } Tracing.TraceMsg("Comparing Source"); if (!ObjectModelHelper.IsSourceIdentical(theOne.Source, theOther.Source)) { return(false); } Tracing.TraceMsg("Comparing Summary"); if (!ObjectModelHelper.IsTextConstructIdentical(theOne.Summary, theOther.Summary)) { return(false); } Tracing.TraceMsg("Comparing Title"); if (!ObjectModelHelper.IsTextConstructIdentical(theOne.Title, theOther.Title)) { return(false); } Tracing.TraceMsg("Comparing Rights"); if (!ObjectModelHelper.IsTextConstructIdentical(theOne.Rights, theOther.Rights)) { return(false); } Tracing.TraceMsg("Comparing BaseLink"); if (!ObjectModelHelper.IsBaseLinkIdentical(theOne.Id, theOther.Id)) { return(false); } /* * if (System.DateTime.Compare(theOne.Published, theOther.Published) != 0) * { * return false; * } * if (System.DateTime.Compare(theOne.Updated,theOther.Updated) != 0) * { * return false; * } */ Tracing.TraceMsg("Exiting IsEntryIdentical"); return(true); }