Ejemplo n.º 1
0
        /////////////////////////////////////////////////////////////////////////////
        //////////////////////////////////////////////////////////////////////
        /// <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);
        }