/// <summary>
        /// overwritten Query method
        /// </summary>
        /// <param name="feedQuery">The FeedQuery to use</param>
        /// <returns>the retrieved EmailListRecipientFeed</returns>
        public EmailListRecipientFeed Query(EmailListRecipientQuery feedQuery)
        {
            try
            {
                Stream feedStream = Query(feedQuery.Uri);
                EmailListRecipientFeed feed = new EmailListRecipientFeed(feedQuery.Uri, this);
                feed.Parse(feedStream, AlternativeFormat.Atom);
                feedStream.Close();

                if (feedQuery.RetrieveAllRecipients)
                {
                    AtomLink next, prev = null;
                    while ((next = feed.Links.FindService("next", null)) != null && next != prev)
                    {
                        feedStream = Query(new Uri(next.HRef.ToString()));
                        feed.Parse(feedStream, AlternativeFormat.Atom);
                        feedStream.Close();

                        prev = next;
                    }
                }

                return feed;
            }
            catch (GDataRequestException e)
            {
                AppsException a = AppsException.ParseAppsException(e);
                throw (a == null ? e : a);
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        /// overwritten Query method
        /// </summary>
        /// <param name="feedQuery">The FeedQuery to use</param>
        /// <returns>the retrieved EmailListRecipientFeed</returns>
        public EmailListRecipientFeed Query(EmailListRecipientQuery feedQuery)
        {
            try
            {
                Stream feedStream           = Query(feedQuery.Uri);
                EmailListRecipientFeed feed = new EmailListRecipientFeed(feedQuery.Uri, this);
                feed.Parse(feedStream, AlternativeFormat.Atom);
                feedStream.Close();

                if (feedQuery.RetrieveAllRecipients)
                {
                    AtomLink next, prev = null;
                    while ((next = feed.Links.FindService("next", null)) != null && next != prev)
                    {
                        feedStream = Query(new Uri(next.HRef.ToString()));
                        feed.Parse(feedStream, AlternativeFormat.Atom);
                        feedStream.Close();

                        prev = next;
                    }
                }

                return(feed);
            }
            catch (GDataRequestException e)
            {
                AppsException a = AppsException.ParseAppsException(e);
                throw (a == null ? e : a);
            }
        }
Ejemplo n.º 3
0
        /////////////////////////////////////////////////////////////////////////////

        /// <summary>
        /// Inserts a new email list recipient entry into the specified feed.
        /// </summary>
        /// <param name="feed">the feed into which this entry should be inserted</param>
        /// <param name="entry">the entry to insert</param>
        /// <returns>the inserted entry</returns>
        public EmailListRecipientEntry Insert(EmailListRecipientFeed feed, EmailListRecipientEntry entry)
        {
            try
            {
                return(base.Insert(feed, entry) as EmailListRecipientEntry);
            }
            catch (GDataRequestException e)
            {
                AppsException a = AppsException.ParseAppsException(e);
                throw (a == null ? e : a);
            }
        }
        /////////////////////////////////////////////////////////////////////////////

        /// <summary>
        /// Inserts a new email list recipient entry into the specified feed.
        /// </summary>
        /// <param name="feed">the feed into which this entry should be inserted</param>
        /// <param name="entry">the entry to insert</param>
        /// <returns>the inserted entry</returns>
        public EmailListRecipientEntry Insert(EmailListRecipientFeed feed, EmailListRecipientEntry entry)
        {
            try
            {
                return base.Insert(feed, entry) as EmailListRecipientEntry;
            }
            catch (GDataRequestException e)
            {
                AppsException a = AppsException.ParseAppsException(e);
                throw (a == null ? e : a);
            }
        }