Ejemplo n.º 1
0
        public void FillWithChildren()
        {
            try
            {
                FeedResponse<dynamic> docs;
                using (PerfStatus.Start("ReadDocumentFeed"))
                {
                    if (!string.IsNullOrWhiteSpace(GlobalQuery))
                    {
                        FeedOptions feedOptions = Program.GetMain().GetFeedOptions();
                        var q =
                            this.client.CreateDocumentQuery(
                                (this.Tag as Documents.DocumentCollection).GetLink(this.client), GlobalQuery, feedOptions)
                                .AsDocumentQuery();
                        docs = q.ExecuteNextAsync().Result;
                    }
                    else
                    {
                        docs = this.client.ReadDocumentFeedAsync(((Documents.DocumentCollection)this.Tag).GetLink(this.client)).Result;
                    }
                }

                foreach (var doc in docs)
                {
                    DocumentNode node = new DocumentNode(client, doc, ResourceType.Document);
                    this.Nodes.Add(node);
                }
                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);
            }
        }
Ejemplo n.º 2
0
        public void FillWithChildren()
        {
            try
            {
                FeedResponse<Documents.Conflict> feedConflicts;
                using (PerfStatus.Start("ReadConflictsFeed"))
                {
                    feedConflicts = this.client.ReadConflictFeedAsync((this.Parent.Tag as Documents.DocumentCollection).GetLink(this.client)).Result;
                }

                foreach (var sp in feedConflicts)
                {
                    DocumentNode node = new DocumentNode(client, sp, ResourceType.Conflict);
                    this.Nodes.Add(node);
                }
                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);
            }

        }
Ejemplo n.º 3
0
        public void FillWithChildren()
        {
            try
            {
                FeedResponse<Documents.Offer> feedOffers = this.client.ReadOffersFeedAsync().Result;

                foreach (var sp in feedOffers)
                {
                    DocumentNode node = new DocumentNode(client, sp, ResourceType.Offer);
                    this.Nodes.Add(node);
                }
                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);
            }

        }
Ejemplo n.º 4
0
        public void FillWithChildren()
        {
            try
            {
                FeedResponse<Documents.Permission> sps;
                using (PerfStatus.Start("ReadPermission"))
                {
                    sps = this.client.ReadPermissionFeedAsync((this.Parent.Tag as Documents.User).GetLink(this.client)).Result;
                }

                foreach (var sp in sps)
                {
                    DocumentNode node = new DocumentNode(client, sp, ResourceType.Permission);
                    this.Nodes.Add(node);
                }
                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);
            }

        }
Ejemplo n.º 5
0
        public void FillWithChildren()
        {
            try
            {
                FeedResponse<Documents.Attachment> attachments;
                using (PerfStatus.Start("ReadAttachmentFeed"))
                {
                     attachments = this.client.ReadAttachmentFeedAsync((this.Tag as Documents.Document).GetLink(this.client)).Result;
                }
                foreach (var attachment in attachments)
                {
                    DocumentNode node = new DocumentNode(client, attachment, ResourceType.Attachment);
                    this.Nodes.Add(node);
                }
                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);
            }
        }
Ejemplo n.º 6
0
        public void FillWithChildren()
        {
            try
            {
                FeedResponse<dynamic> docs;
                using (PerfStatus.Start("ReadDocumentFeed"))
                {
                     docs = this.client.ReadDocumentFeedAsync(((Documents.DocumentCollection)this.Tag).GetLink(this.client)).Result;
                }

                foreach (var doc in docs)
                {
                    DocumentNode node = new DocumentNode(client, doc, ResourceType.Document);
                    this.Nodes.Add(node);
                }
                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);
            }
        }
Ejemplo n.º 7
0
        public void FillWithChildren()
        {
            try
            {
                FeedResponse<Documents.User> sps = this.client.ReadUserFeedAsync((this.Parent.Tag as Documents.Database).SelfLink).Result;

                foreach (var sp in sps)
                {
                    DocumentNode node = new DocumentNode(client, sp, ResourceType.User);
                    this.Nodes.Add(node);
                }
                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);
            }

        }
Ejemplo n.º 8
0
        public void FillWithChildren()
        {
            try
            {
                DocumentCollectionNode collnode = (DocumentCollectionNode)this.Parent;
                FeedResponse<Documents.StoredProcedure> sps = this.client.ReadStoredProcedureFeedAsync((collnode.Tag as Documents.DocumentCollection).SelfLink).Result;

                foreach (var sp in sps)
                {
                    DocumentNode node = new DocumentNode(client, sp, ResourceType.StoredProcedure);
                    this.Nodes.Add(node);
                }
                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);
            }
        }