public void FillWithChildren()
        {
            try
            {
                DocumentCollectionNode collnode = (DocumentCollectionNode) Parent;
                FeedResponse<Trigger> sps;
                using (PerfStatus.Start("ReadTriggerFeed"))
                {
                    sps = _client.ReadTriggerFeedAsync((collnode.Tag as DocumentCollection).GetLink(_client)).Result;
                }

                foreach (var sp in sps)
                {
                    DocumentNode nodeBase = new DocumentNode(_client, sp, ResourceType.Trigger);
                    Nodes.Add(nodeBase);
                }
                Program.GetMain().SetResponseHeaders(sps.ResponseHeaders);
            }
            catch (AggregateException e)
            {
                Program.GetMain().SetResultInBrowser(null, e.InnerException.ToString(), true);
            }
            catch (Exception e)
            {
                Program.GetMain().SetResultInBrowser(null, e.ToString(), true);
            }
        }
        public void FillWithChildren()
        {
            try
            {
                FeedResponse<Conflict> feedConflicts;
                using (PerfStatus.Start("ReadConflictsFeed"))
                {
                    feedConflicts =
                        _client.ReadConflictFeedAsync((Parent.Tag as DocumentCollection).GetLink(_client)).Result;
                }

                foreach (var sp in feedConflicts)
                {
                    DocumentNode nodeBase = new DocumentNode(_client, sp, ResourceType.Conflict);
                    Nodes.Add(nodeBase);
                }
                Program.GetMain().SetResponseHeaders(feedConflicts.ResponseHeaders);
            }
            catch (AggregateException e)
            {
                Program.GetMain().SetResultInBrowser(null, e.InnerException.ToString(), true);
            }
            catch (Exception e)
            {
                Program.GetMain().SetResultInBrowser(null, e.ToString(), true);
            }
        }
        public void FillWithChildren()
        {
            try
            {
                FeedResponse<Offer> feedOffers = _client.ReadOffersFeedAsync().Result;

                foreach (var sp in feedOffers)
                {
                    DocumentNode nodeBase = new DocumentNode(_client, sp, ResourceType.Offer);
                    Nodes.Add(nodeBase);
                }
                Program.GetMain().SetResponseHeaders(feedOffers.ResponseHeaders);
            }
            catch (AggregateException e)
            {
                Program.GetMain().SetResultInBrowser(null, e.InnerException.ToString(), true);
            }
            catch (Exception e)
            {
                Program.GetMain().SetResultInBrowser(null, e.ToString(), true);
            }
        }
 public void FillWithChildren()
 {
     try
     {
         FeedResponse<Attachment> attachments;
         using (PerfStatus.Start("ReadAttachmentFeed"))
         {
             attachments = _client.ReadAttachmentFeedAsync((Tag as Document).GetLink(_client)).Result;
         }
         foreach (var attachment in attachments)
         {
             DocumentNode nodeBase = new DocumentNode(_client, attachment, ResourceType.Attachment);
             Nodes.Add(nodeBase);
         }
         Program.GetMain().SetResponseHeaders(attachments.ResponseHeaders);
     }
     catch (AggregateException e)
     {
         Program.GetMain().SetResultInBrowser(null, e.InnerException.ToString(), true);
     }
     catch (Exception e)
     {
         Program.GetMain().SetResultInBrowser(null, e.ToString(), true);
     }
 }
        public void FillWithChildren()
        {
            try
            {
                FeedResponse<dynamic> docs;
                using (PerfStatus.Start("ReadDocumentFeed"))
                {
                    if (!string.IsNullOrWhiteSpace(GlobalQuery))
                    {
                        FeedOptions feedOptions = Program.GetMain().GetFeedOptions();
                        var q =
                            _client.CreateDocumentQuery(
                                (Tag as DocumentCollection).GetLink(_client), GlobalQuery, feedOptions)
                                .AsDocumentQuery();
                        docs = q.ExecuteNextAsync().Result;
                    }
                    else
                    {
                        docs = _client.ReadDocumentFeedAsync(((DocumentCollection) Tag).GetLink(_client)).Result;
                    }
                }

                foreach (var doc in docs)
                {
                    DocumentNode nodeBase = new DocumentNode(_client, doc, ResourceType.Document);
                    Nodes.Add(nodeBase);
                }
                Program.GetMain().SetResponseHeaders(docs.ResponseHeaders);
            }
            catch (AggregateException e)
            {
                Program.GetMain().SetResultInBrowser(null, e.InnerException.ToString(), true);
            }
            catch (Exception e)
            {
                Program.GetMain().SetResultInBrowser(null, e.ToString(), true);
            }
        }