/// <summary> /// Creates an empty OneNote page with the given display name in the given section. Requires an authenticated /// GraphServiceClient. /// </summary> /// <param name="client">An authenticated GraphServiceClient containing the user's access token.</param> /// <param name="displayName">The name of the page to be created.</param> /// <param name="parentSection">The section that should contain the given page.</param> /// <returns>The created page.</returns> public static async Task <OnenotePage> CreatePage(GraphServiceClient client, string displayName, OnenoteSection parentSection) { string emptyPageHtml = $"<html><head><title>{displayName}</title></head><body><div><p>placeholder</p></div></body></html>"; return(await client.Me.Onenote.Sections[parentSection.Id].Pages.Request().AddAsync(emptyPageHtml, "text/html")); }
private async Task <IOnenoteSectionPagesCollectionPage> GetPagesInSection(OnenoteSection section) { var pages = await client.Me.Onenote.Sections[section.Id].Pages.Request().GetAsync(); return(pages); }
private async Task <OnenoteSection> AddItemAsync(OnenoteSection item, string parentId) { var result = await client.Me.Onenote.Notebooks[parentId].Sections.Request().AddAsync(item); return(result); }