예제 #1
0
        /////////////////////////////////////////////////////////////////////////////

        //////////////////////////////////////////////////////////////////////
        /// <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");
            }

            this.title           = updatedEntry.Title;
            this.authors         = updatedEntry.Authors;
            this.id              = updatedEntry.Id;
            this.links           = updatedEntry.Links;
            this.lastUpdateDate  = updatedEntry.Updated;
            this.publicationDate = updatedEntry.Published;
            this.authors         = updatedEntry.Authors;
            this.rights          = updatedEntry.Rights;
            this.categories      = updatedEntry.Categories;
            this.summary         = updatedEntry.Summary;
            this.content         = updatedEntry.Content;
            this.source          = updatedEntry.Source;

            this.ExtensionElements.Clear();

            foreach (IExtensionElementFactory extension in updatedEntry.ExtensionElements)
            {
                this.ExtensionElements.Add(extension);
            }
        }
예제 #2
0
 /// <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 (this.Uri != null)
            {
                return(this.Uri.CompareTo(other.Uri));
            }

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

            return(-1);
        }