/// <summary>takes the updated entry returned and sets the properties to this object</summary>
        /// <param name="updatedEntry"> </param>
        protected void CopyEntry(AtomEntry updatedEntry)
        {
            Tracing.Assert(updatedEntry != null, "updatedEntry should not be null");
            if (updatedEntry == null)
            {
                throw new ArgumentNullException("updatedEntry");
            }

            _title           = updatedEntry.Title;
            _authors         = updatedEntry.Authors;
            _id              = updatedEntry.Id;
            _links           = updatedEntry.Links;
            _lastUpdateDate  = updatedEntry.Updated;
            _publicationDate = updatedEntry.Published;
            _authors         = updatedEntry.Authors;
            _rights          = updatedEntry.Rights;
            _categories      = updatedEntry.Categories;
            _summary         = updatedEntry.Summary;
            _content         = updatedEntry.Content;
            _source          = updatedEntry.Source;

            ExtensionElements.Clear();

            foreach (IExtensionElementFactory extension in updatedEntry.ExtensionElements)
            {
                ExtensionElements.Add(extension);
            }
        }
        /// <summary>Fins an atomEntry in the collection
        /// based on it's ID. </summary>
        /// <param name="value">The atomId to look for</param>
        /// <returns>Null if not found, otherwise the entry</returns>
        public AtomEntry FindById(AtomId value)
        {
            if (value == null)
            {
                throw new ArgumentNullException("value");
            }

            foreach (AtomEntry entry in List)
            {
                if (entry.Id.AbsoluteUri == value.AbsoluteUri)
                {
                    return(entry);
                }
            }

            return(null);
        }
示例#3
0
        /// <summary>
        /// overloaded IComparable interface method
        /// </summary>
        /// <param name="obj">the object to compare this instance with</param>
        /// <returns>int</returns>
        public int CompareTo(object obj)
        {
            AtomId other = obj as AtomId;

            if (other == null)
            {
                return(-1);
            }

            if (Uri != null)
            {
                return(Uri.CompareTo(other.Uri));
            }

            if (other.Uri == null)
            {
                return(0);
            }

            return(-1);
        }