or, asssuming you are using 1.4.0.2 you could write this code:

// you need to have the fake settings object, but you won't use it...
// this is because there is no direct oauth support via  
requestsettings yet
RequestSettings rs = new RequestSettings(this.ApplicationName,  
this.userName, this.passWord);
             rs.AutoPaging = true;
             ContactsRequest cr = new ContactsRequest(rs);
            cr.Service = <youroauthsetup service>

             Feed<Group> fg = cr.GetGroups();

            foreach(Group g in fg.Entries)
                /// this will automatically page when you reach the end..

Frank


On Apr 23, 2009, at 12:45 PM, andreroy55 wrote:

>
> Ah... never mind. Just because the code compiles and doesn't throw an
> error while executing doesn't mean it's right. :/
>
>
> I should be creating a GroupsQuery, setting the max-results in there
> and then passing that query onto the GroupsFeed. <sigh> Now for other
> bugs.
>
>
>
>
> On Apr 23, 2:09 pm, Andre Roy <[email protected]> wrote:
>> I'm (still:) writing the program. Anyway, at one point I need to
>> retrieve all the contact groups of one user. In this case, the user  
>> has
>> 28 groups but all I can retrieve is 25. A bit of searching found
>> "max-results" and a snippet, so I tried that. I still only get 25 :(
>>
>> This is (more or less) what I have:
>>
>> private void GetGoogleGroups(string u)
>> //
>> // string u -- the user for whom we want the list of Google groups
>> //
>>
>> {
>>    GroupEntry[] GroupEntry = new GroupEntry[] { };
>>    Uri groupUri = new
>>      OAuthUri("http://www.google.com/m8/feeds/groups/default/full";,
>>       u, NU_DOMN);
>>
>>    ContactsService service = new ContactsService(NU_PROG);
>>    service.RequestFactory = Contact_sckGoog;
>>
>>    ContactsQuery query = new ContactsQuery();
>>    // this is the code snipped I found, doesn't generate an
>>    // error. Doesn't generate more than 25, either
>>    query.ExtraParameters = "max-results=300";
>>    query.Uri             = groupUri;
>>
>>    GroupsFeed GroupsFeed = service.Query(new
>>                     GroupsQuery(groupUri.AbsoluteUri));
>>
>>    foreach (GroupEntry e in GroupsFeed.Entries)
>>    {
>>      LogLine("GetGoogleGroups()  e.Title.text=" + e.Title.Text +  
>> "=");
>>    }
>> return;
>>
>> }
>>
>> Yes, it's kind of hard to read. There are a few things that are  
>> defined
>> statically file-wide, so don't worry that they don't look defined in
>> this function.
>>
>> I tried setting "max-results" to 99999, when that didn't work, I  
>> figured
>> it might be a tad too much, so tried 300. No one's going to have more
>> than 300 groups, right?  :) I hope.
>>
>> Anyway, how does one go about getting the rest of the contacts?
>>
>> --
>> Andre -- If it's unworkable, it's a go!
> >


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google Contacts API" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/google-contacts-api?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to