Exemplo n.º 1
0
        public static async Task <List <OneNoteDescriptor> > GetAllPages()
        {
            List <OneNoteDescriptor> res = new List <OneNoteDescriptor>();
            var pages = await _graphClient.Me.Onenote.Pages.Request().GetAsync();

            foreach (var aPage in pages)
            {
                OneNoteDescriptor d = new OneNoteDescriptor();
                d.PageId    = aPage.Id;
                d.PageTitle = aPage.Title;
                res.Add(d);
            }
            return(res);
        }
Exemplo n.º 2
0
        public static void Init()
        {
            Logger.Info("Before retrieve OneNotePages");
            //Retrieve all OneNotePages, and see which ones are opted in
            var OneNote = OneNoteCapture.GetAllPages().Result;
            var optedIn = from x in OneNote  where x.PageTitle.ToLower() == ONENOTE_DESTINATION_PAGE_NAME select x;

            if (optedIn.First() != null)
            {
                DestinationOneNote = optedIn.First();
            }
            else
            {
                throw new System.Exception("Destination OneNote page with name 'OACapture' was not found");
            }
            Logger.Info("After retrieve OneNotePages");
        }