Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var newObjClientContext = this.GetSharePointClientContext(accessToken, fullUri);
- WebCollection collWeb = newObjClientContext.Web.GetSubwebsForCurrentUser(new SubwebQuery());
- var documentLibrary = newObjClientContext.Web.Lists.GetById(docID);
- ListItemCollectionPosition itemPosition = new ListItemCollectionPosition();
- itemPosition.PagingInfo = string.Format("Paged=TRUE&p_ID={0}", iSkip); //Skip thingy doesn't work with Order By
- ListItemCollection ltitems = null;
- string vquery = @"<View >
- <Query>
- <Where>
- <Or>
- <Eq>
- <FieldRef Name='FSObjType' />
- <Value Type='Lookup'>1</Value>
- </Eq>
- <Eq>
- <FieldRef Name='FSObjType' />
- <Value Type='Lookup'>0</Value>
- </Eq>
- </Or>
- </Where>
- <OrderBy><FieldRef Name='FileLeafRef' Ascending='TRUE'></FieldRef></OrderBy>
- </Query>
- <RowLimit>" + recCount + @"</RowLimit>
- </View>";
- CamlQuery camlQuery = new CamlQuery();
- camlQuery.ListItemCollectionPosition = itemPosition; //This is ignored.
- camlQuery.ViewXml = vquery;
- ltitems = documentLibrary.GetItems(camlQuery);
- newObjClientContext.Load(documentLibrary);
- newObjClientContext.Load(ltitems, lists => lists.IncludeWithDefaultProperties(l => l.ParentList));
- newObjClientContext.ExecuteQuery();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement