/// <summary>
 /// overwritten Query method
 /// </summary>
 /// <param name="uri">The URI for the query</param>
 /// <returns>the retrieved AppsExtendedFeed</returns>
 public AppsExtendedFeed QueryGroups(Uri uri)
 {
     try
     {
         Stream           feedStream = Query(uri);
         AppsExtendedFeed feed       = new AppsExtendedFeed(uri, this);
         feed.Parse(feedStream, AlternativeFormat.Atom);
         feedStream.Close();
         if (true)
         {
             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);
     }
 }
 /// <summary>
 /// Updates this GoogleMailSettingsEntry.
 /// </summary>
 /// <returns>the updated GoogleMailSettingsEntry</returns>
 public new GoogleMailSettingsEntry Update()
 {
     try
     {
         return(base.Update() as GoogleMailSettingsEntry);
     }
     catch (GDataRequestException e)
     {
         AppsException a = AppsException.ParseAppsException(e);
         throw (a == null ? e : a);
     }
 }
Beispiel #3
0
        /// <summary>
        /// Checks whether an user is a group owner.
        /// </summary>
        /// <param name="ownerEmail">Email of the owner that is being checked</param>
        /// <param name="groupId">The ID of the group for which you wish to check the ownership</param>
        /// <returns>True if the user is an owner of the group, false otherwise</returns>
        public bool IsOwner(String ownerEmail, String groupId)
        {
            try {
                OwnerEntry entry = RetrieveOwner(ownerEmail, groupId);
                return(entry != null);
            } catch (GDataRequestException e) {
                AppsException appsException = AppsException.ParseAppsException(e);
                if (appsException == null)
                {
                    return(false);
                }

                if (appsException.ErrorCode.Equals(AppsException.EntityDoesNotExist))
                {
                    return(false);
                }
                else
                {
                    throw appsException;
                }
            }
        }
 public void Init()
 {
     exception = new AppsException();
 }