예제 #1
0
        protected XMLTree GET(String resource)
        {
            string  xml  = GETxml(resource);
            XMLTree tree = new XMLTree(xml);
            String  next = "";

            do
            {
                try
                {
                    next = tree.ChildTrees.Where(t => t.TagName.Equals("links")).Single().ChildNodes.Where(n => n.TagName.Equals("next")).Single().Value;
                    next = next.Replace("amp%3Blimit=20&", "");
                    tree.ChildTrees.Remove(tree.ChildTrees.Where(t => t.TagName.Equals("links")).Single());
                    string nxml = "";
                    using (SchoologyAPICall newCall = new SchoologyAPICall())
                    {
                        string rscr = next.Substring(next.IndexOf("v1"));
                        nxml = newCall.GETxml(rscr);
                    }
                    tree = tree.MergeWith(new XMLTree(nxml));
                }
                catch
                {
                    next = "";
                }
            } while (!next.Equals(""));

            return(tree);
        }