/// <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);
     }
 }
Beispiel #2
0
 /// <summary>
 /// Returns the feed at the end URI specified.
 /// </summary>
 /// <param name="uri">the URI of the feed</param>
 /// <param name="shouldGetAllPages">if true, returns all the pages</param>
 /// <returns></returns>
 public AppsExtendedFeed QueryExtendedFeed(Uri uri, Boolean shouldGetAllPages)
 {
     try
     {
         Stream           feedStream = base.Query(uri);
         AppsExtendedFeed feed       = new AppsExtendedFeed(uri, this);
         feed.Parse(feedStream, AlternativeFormat.Atom);
         feedStream.Close();
         if (shouldGetAllPages)
         {
             if (true)
             {
                 AtomLink next, prev = null;
                 while ((next = feed.Links.FindService("next", null)) != null &&
                        next != prev)
                 {
                     feedStream = base.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);
     }
 }
Beispiel #3
0
            public GDataTypes.GDataGroupOwnerEntrys CreateGroupOwnerEntrys(AppsExtendedFeed groupOwnerEntrys)
            {
                var _gDataGroupOwnerEntrys = new GDataTypes.GDataGroupOwnerEntrys();
                foreach (AppsExtendedEntry _groupOwnerEntry in groupOwnerEntrys.Entries)
                {
                    var _gDataGroupOwnerEntry = new GDataTypes.GDataGroupOwnerEntry();
                    foreach (var _setting in _groupOwnerEntry.Properties)
                    {
                        if (_setting.Name == "email")
                        {
                            _gDataGroupOwnerEntry.MemberId = _setting.Value;
                        }
                        else if (_setting.Name == "type")
                        {
                            _gDataGroupOwnerEntry.MemberType = _setting.Value;
                        }

                    }
                    _gDataGroupOwnerEntrys.Add(_gDataGroupOwnerEntry);
                }
                return _gDataGroupOwnerEntrys;
            }
Beispiel #4
0
            public GDataTypes.GDataGroupEntrys CreateGroupEntrys(AppsExtendedFeed groupEntrys)
            {
                var _gDataGroupEntrys = new GDataTypes.GDataGroupEntrys();
                foreach (AppsExtendedEntry _groupEntry in groupEntrys.Entries)
                {
                    var _gDataGroupEntry = new GDataTypes.GDataGroupEntry();
                    _gDataGroupEntry.SelfUri = _groupEntry.SelfUri.ToString();
                    foreach (var _setting in _groupEntry.Properties)
                    {
                        if (_setting.Name == "groupId")
                        {
                            _gDataGroupEntry.GroupId = _setting.Value;
                        }
                        else if (_setting.Name == "groupName")
                        {
                            _gDataGroupEntry.GroupName = _setting.Value;
                        }
                        else if (_setting.Name == "description")
                        {
                            _gDataGroupEntry.Description = _setting.Value;
                        }
                        else if (_setting.Name == "emailPermission")
                        {
                            _gDataGroupEntry.EmailPermission = _setting.Value;
                        }

                    }
                    _gDataGroupEntrys.Add(_gDataGroupEntry);
                }

                return _gDataGroupEntrys;
            }