/// <summary>
        /// returns the resumabled create media Uri for a given entry
        /// </summary>
        /// <param name="entry"></param>
        /// <returns></returns>
        public static Uri GetResumableCreateUri(AtomLinkCollection links)
        {
            // scan the link collection
            AtomLink link = links.FindService(CreateMediaRelation, null);

            return(link == null ? null : new Uri(link.AbsoluteUri));
        }
Example #2
0
 public static string GetHrefContent(this AtomLinkCollection links, LinkType feedType = LinkType.listfeed)
 {
     foreach (var link in links)
     {
         if (link.Rel.EndsLike(feedType.ToString()))
         {
             return(link.HRef.Content);
         }
     }
     return(null);
 }
Example #3
0
        private string GetPostLinkManually(AtomLinkCollection links)
        {
            foreach (AtomLink link in links)
            {
                if (link.Rel.CompareTo("alternate") == 0)
                {
                    return(link.HRef.Content);
                }
            }

            return("");
        }
Example #4
0
        private string GetEventFeedRel(AtomLinkCollection collection)
        {
            foreach (AtomLink link in collection)
            {
                if (link.Rel == EventFeedRel)
                {
                    return(link.AbsoluteUri);
                }
            }

            return(null);
        }
        /////////////////////////////////////////////////////////////////////////////

        //////////////////////////////////////////////////////////////////////
        /// <summary>verifies the categroy collection</summary>
        /// <param name="theOne">the One Collection </param>
        /// <param name="theOther">the Other Collection </param>
        /// <returns>true if identical </returns>
        //////////////////////////////////////////////////////////////////////
        public static bool IsLinkCollectionIdentical(AtomLinkCollection theOne, AtomLinkCollection theOther)
        {
            if (theOne == null && theOther == null)
            {
                return(true);
            }
            if (theOne.Count != theOther.Count)
            {
                return(false);
            }
            for (int i = 0; i < theOne.Count; i++)
            {
                if (!IsLinkIdentical(theOne[i], theOther[i]))
                {
                    return(false);
                }
            }

            return(true);
        }
 /// <summary>
 /// returns the resumabled create media Uri for a given entry
 /// </summary>
 /// <param name="entry"></param>
 /// <returns></returns>
 public static Uri GetResumableCreateUri(AtomLinkCollection links) {
     // scan the link collection
     AtomLink link = links.FindService(CreateMediaRelation, null);
     return link == null ? null : new Uri(link.AbsoluteUri);
 }
 public void Init()
 {
     links      = new AtomLinkCollection();
     fistLink   = new AtomLink();
     secondLink = new AtomLink();
 }
Example #8
0
 public void Init()
 {
     links      = new AtomLinkCollection();
     fistLink   = new AtomLink(new Uri("http://purl.org/atom/ns#"));
     secondLink = new AtomLink(new Uri("http://purl.org/atom/ns#"));
 }