private void LoadResults(ODItemCollection results) { Results = results; oneDriveObjectBrowser1.SelectedItem = results; buttonGetNext.Enabled = results.MoreItemsAvailable(); }
public FormSyncResults(ODConnection connection, ODItemCollection result) { InitializeComponent(); Connection = connection; Results = result; }
/// <summary> /// Gets the next page of items as an ODItemCollection /// </summary> /// <param name="itemCollection"></param> /// <param name="connection"></param> /// <returns></returns> public static async Task <ODItemCollection> GetNextPage(this ODItemCollection itemCollection, ODConnection connection) { if (null == connection) { throw new ArgumentNullException("connection"); } if (itemCollection.MoreItemsAvailable()) { return(await connection.DataModelForRequest <ODItemCollection>(new Uri(itemCollection.NextLink), ApiConstants.HttpGet)); } else { return(new ODItemCollection()); } }
private async void ProcessFolder(ODItem folder) { if (null != folder) { this.CurrentFolder = folder; LoadProperties(folder); ODItemCollection pagedItemCollection = await folder.PagedChildrenCollectionAsync(Connection, ChildrenRetrievalOptions.DefaultWithThumbnails); LoadChildren(pagedItemCollection, false); while (pagedItemCollection.MoreItemsAvailable()) { pagedItemCollection = await pagedItemCollection.GetNextPage(Connection); LoadChildren(pagedItemCollection, false); } } }
private void LoadChildren(ODItemCollection items, bool clearExistingItems = true) { flowLayoutContents.SuspendLayout(); if (clearExistingItems) flowLayoutContents.Controls.Clear(); // Load the children if (null != items) { List<Control> newControls = new List<Control>(); foreach (var obj in items.Collection) { newControls.Add(CreateControlForChildObject(obj)); } flowLayoutContents.Controls.AddRange(newControls.ToArray()); } flowLayoutContents.ResumeLayout(); }
public async static Task <ODItemCollection> GetNextResponseCollection(ODItemCollection previousCollection, ODConnection connection) { if (null == connection) { throw new ArgumentNullException("connection"); } if (null == previousCollection) { throw new ArgumentNullException("previousCollection"); } if (previousCollection.MoreItemsAvailable()) { return(await connection.DataModelForRequest <ODItemCollection>(new Uri(previousCollection.NextLink), ApiConstants.HttpGet)); } else { return(null); } }
private void LoadChildren(ODItemCollection items, bool clearExistingItems = true) { flowLayoutContents.SuspendLayout(); if (clearExistingItems) { flowLayoutContents.Controls.Clear(); } // Load the children if (null != items) { List <Control> newControls = new List <Control>(); foreach (var obj in items.Collection) { newControls.Add(CreateControlForChildObject(obj)); } flowLayoutContents.Controls.AddRange(newControls.ToArray()); } flowLayoutContents.ResumeLayout(); }