c# - Using the Microsoft Exchange Services Managed API, what happens when there are more than 512 items to sync? -
given following code:
exchangeservice service = exchangeserviceutilities.createexchangeservice(s, u); changecollection<folderchange> folderchanges = null; { folderchanges = service.syncfolderhierarchy(propertyset.idonly, u.watermark); // update synchronization u.watermark = folderchanges.syncstate; // process changes. if required, add getitem call here request additional properties. foreach (var foldercontentschange in folderchanges) { // example prints changetype , itemid console. // lob application apply business rules each changecollection<itemchange> changelist = null; { string value = u.syncstates.containskey(foldercontentschange.folderid) ? u.syncstates[foldercontentschange.folderid] : null; changelist = service.syncfolderitems(foldercontentschange.folderid, propertyset.firstclassproperties, null,512, syncfolderitemsscope.normalitems, value); u.syncstates[foldercontentschange.folderid] = changelist.syncstate; foreach (var itemchange in changelist) { } } while (changelist.morechangesavailable); } } while (folderchanges.morechangesavailable);
what happens when there more 512 items? items picked in subsequent passes of do(), or need call sync again?
if there more 512 items, morechangesavailable flag set. in code, do...while(changelist.morechangesavailable) run till there more items returned syncfolderitems() call.(in case 512) each time loop executed, sets syncstate value obtained in previous call @ line:
u.syncstates[foldercontentschange.folderid] = changelist.syncstate;
this ensures not receive items received.
Comments
Post a Comment