// Token: 0x0600223D RID: 8765 RVA: 0x0007E938 File Offset: 0x0007CB38
        private OneDriveProItemsPage UpdatePageCache(IClientContext clientContext, UserContext userContext, IList list, string listName, string location, IndexedPageView requestedData, AttachmentItemsSort sort, DataProviderCallLogEvent logEvent)
        {
            string changeToken;
            bool   flag;

            this.GetListItemChangesSinceToken(clientContext, userContext.LogonIdentity, listName, location, out changeToken, out flag, logEvent);
            this.ChangeToken = changeToken;
            if (flag)
            {
                this.PageMap.Clear();
            }
            int num = this.ComputeStartPageIndex(requestedData);
            OneDriveProItemsPage nearestPage = this.GetNearestPage(num);
            int num2 = (nearestPage != null) ? nearestPage.PageIndex : -1;

            if (nearestPage == null || num != nearestPage.PageIndex)
            {
                ListItemCollectionPosition listItemCollectionPosition = this.GetListItemCollectionPosition(nearestPage);
                CamlQuery           query = OneDriveProUtilities.CreatePagedCamlPageQuery(location, sort, listItemCollectionPosition, Math.Abs(num - num2) * 200 + 200);
                IListItemCollection items = list.GetItems(query);
                items.Load(clientContext, new Expression <Func <ListItemCollection, object> > [0]);
                OneDriveProUtilities.ExecuteQueryWithTraces(userContext, clientContext, logEvent, "UpdatePageCache");
                this.UpdateCache(items, nearestPage);
            }
            OneDriveProItemsPage result;

            this.PageMap.TryGetValue(num, out result);
            return(result);
        }
        // Token: 0x0600223B RID: 8763 RVA: 0x0007E7A4 File Offset: 0x0007C9A4
        internal IEnumerable <IListItem> GetItems(UserContext userContext, string endPointUrl, string documentLibrary, string location, IndexedPageView requestedData, AttachmentItemsSort sort, out int totalItemCount, DataProviderCallLogEvent logEvent)
        {
            IEnumerable <IListItem> result;

            using (IClientContext clientContext = OneDriveProUtilities.CreateAndConfigureClientContext(userContext.LogonIdentity, endPointUrl))
            {
                totalItemCount = 0;
                IList documentsLibrary             = OneDriveProUtilities.GetDocumentsLibrary(clientContext, documentLibrary);
                OneDriveProItemsPage page          = this.UpdatePageCache(clientContext, userContext, documentsLibrary, documentLibrary, location, requestedData, sort, logEvent);
                CamlQuery            camlDataQuery = this.GetCamlDataQuery(location, requestedData, this.GetListItemCollectionPosition(page), sort);
                IListItemCollection  items         = documentsLibrary.GetItems(camlDataQuery);
                IFolder folder = string.IsNullOrEmpty(location) ? documentsLibrary.RootFolder : clientContext.Web.GetFolderByServerRelativeUrl(location);
                items.Load(clientContext, new Expression <Func <ListItemCollection, object> > [0]);
                folder.Load(clientContext, new Expression <Func <Folder, object> >[]
                {
                    (Folder x) => (object)x.ItemCount
                });
                OneDriveProUtilities.ExecuteQueryWithTraces(userContext, clientContext, logEvent, "GetItems");
                int startIndex = requestedData.Offset % 200;
                int endIndex   = startIndex + requestedData.MaxRows;
                totalItemCount = folder.ItemCount;
                result         = items.ToList <IListItem>().Where((IListItem item, int index) => index >= startIndex && index < endIndex);
            }
            return(result);
        }
        // Token: 0x06002241 RID: 8769 RVA: 0x0007EC40 File Offset: 0x0007CE40
        private void UpdateCache(IListItemCollection itemCollection, OneDriveProItemsPage page)
        {
            int num = (page == null) ? -1 : page.PageIndex;

            for (int i = 199; i < itemCollection.Count(); i += 200)
            {
                IListItem item = itemCollection[i];
                int       num2 = i / 200 + num + 1;
                this.PageMap[num2] = new OneDriveProItemsPage(num2, item);
            }
        }
 // Token: 0x06002242 RID: 8770 RVA: 0x0007EC9C File Offset: 0x0007CE9C
 private ListItemCollectionPosition GetListItemCollectionPosition(OneDriveProItemsPage page)
 {
     if (page != null)
     {
         return(new ListItemCollectionPosition
         {
             PagingInfo = string.Format("Paged=TRUE&p_SortBehavior={0}&p_FSObjType={1}&p_FileLeafRef={2}&p_ID={3}", new object[]
             {
                 page.SortBehavior,
                 page.ObjectType,
                 page.Name,
                 page.ID
             })
         });
     }
     return(null);
 }