private static JArray jsonCreateLinkArray(UriLinkList links)
        {
            var result = new JArray();

            foreach (var l in links)
            {
                if (l.Uri != null)
                {
                    result.Add(jsonCreateLink(l.Rel, l.Uri));
                }
            }

            return(result);
        }
Exemplo n.º 2
0
        private static UriLinkList getLinks(JToken token)
        {
            var result = new UriLinkList();
            var links  = token as JArray;

            if (links != null)
            {
                foreach (var link in links)
                {
                    var uri = SerializationUtil.UriValueOrNull(link[BundleXmlParser.XATOM_LINK_HREF]);

                    if (uri != null)
                    {
                        result.Add(new UriLinkEntry
                        {
                            Rel = link.Value <string>(BundleXmlParser.XATOM_LINK_REL),
                            Uri = uri
                        });
                    }
                }
            }

            return(result);
        }
        private static JArray jsonCreateLinkArray(UriLinkList links)
        {
            var result = new JArray();

            foreach (var l in links)
                if (l.Uri != null)
                    result.Add(jsonCreateLink(l.Rel, l.Uri));

            return result;
        }
Exemplo n.º 4
0
 public Bundle()
 {
     Entries = new List<BundleEntry>();
     Links = new UriLinkList();
     Tags = new List<Tag>();
 }
Exemplo n.º 5
0
 public BundleEntry()
 {
     Links = new UriLinkList();
     Tags = new List<Tag>();
 }
Exemplo n.º 6
0
        private static UriLinkList getLinks(JToken token)
        {
            var result = new UriLinkList();
            var links = token as JArray;

            if (links != null)
            {
                foreach (var link in links)
                {
                    var uri = SerializationUtil.UriValueOrNull(link[BundleXmlParser.XATOM_LINK_HREF]);

                    if (uri != null)
                        result.Add(new UriLinkEntry
                        {
                            Rel = link.Value<string>(BundleXmlParser.XATOM_LINK_REL),
                            Uri = uri
                        });
                }
            }

            return result;
        }