/// <summary> /// Respond to the monthView Day header to show daily details /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private async void ShowDayView(object sender, CalendarDayEventArgs e) { contentPanel.Controls.Clear(); if (detailView == null) { detailView = new DetailView { Dock = DockStyle.Fill, Location = new System.Drawing.Point(0, 0), Name = "dayView", TabIndex = 0 }; detailView.HoverPage += ShowPageStatus; detailView.ClickedPage += NavigateToPage; detailView.SnappedPage += SnappedPage; } var endDate = date.EndOfMonth(); var settings = new SettingsProvider(); pages = await new OneNoteProvider().GetPages( date.StartOfCalendarMonthView(), date.EndOfCalendarView(), await settings.GetNotebookIDs(), settings.Created, settings.Modified, settings.Deleted); detailView.SetRange(date, endDate, pages); contentPanel.Controls.Add(detailView); }
private async Task SetMonth(int delta) { if (delta < 1000) { date = delta == 0 ? DateTime.Now.StartOfMonth() : date.AddMonths(delta); } var endDate = date.EndOfMonth(); var settings = new SettingsProvider(); pages = await new OneNoteProvider().GetPages( date.StartOfCalendarMonthView(), date.EndOfCalendarView(), await settings.GetNotebookIDs(), settings.Created, settings.Modified, settings.Deleted); if (monthButton.Checked) { monthView.SetRange(date, endDate, pages); } else { detailView.SetRange(date, endDate, pages); } dateLabel.Text = date.ToString("MMMM yyyy"); nextButton.Enabled = todayButton.Enabled = !DateTime.Now.EqualsMonth(date); }
public async Task <IEnumerable <Notebook> > GetNotebooks() { var notebooks = new List <Notebook>(); var provider = new SettingsProvider(); var ids = await provider.GetNotebookIDs(); var books = await new OneNoteProvider().GetNotebooks(); foreach (var book in books) { book.Checked = ids.Contains(book.ID); notebooks.Add(book); } return(notebooks); }