private void Sched_Loaded(object sender, RoutedEventArgs e) { // Register the Bubble Event Handler when calendar closes AddHandler(OutlookCalendar.Controls.Calendar.CalCosing, new RoutedEventHandler(CalendarClosed)); dbAccess = new CalendarAccess(); string error; //get all appointments allAppts = dbAccess.GetAppointments(out error); //filter those for today List <DataAccessLayer.Models.Appointment> temp = allAppts.Where(a => a.StartTime.ToShortDateString() == DateTime.Now.ToShortDateString()).ToList(); today = new ObservableCollection <DataAccessLayer.Models.Appointment>(temp); lvDataBinding.ItemsSource = today; //populate the right pane with button for the next 6 days and highlite //any that have appointments populateRightPane(); DateChanging = new DispatcherTimer(); DateChanging.Interval = TimeSpan.FromHours(1); DateChanging.Tick += new EventHandler(timer_Tick); DateChanging.Start(); }
private void TestCalendar() { CalendarModel cm = new CalendarModel() { Title = "Jons Test", Description = "Ett test av att skriva till Kalender", Location = "Malmö", Start = DateTime.Now, End = DateTime.Now }; CalendarAccess ca = new CalendarAccess(cm); }
public async Task <IDictionary <string, string> > GetCalendarIdsAsync(CalendarAccess accessLevel) { var calendarIds = new Dictionary <string, string>(); var req = await _service.GetCalendarListItemsExecuteAsyncItems(); foreach (var calendarListEntry in req.Where(x => x.AccessRole.Equals(accessLevel.ToString().ToLower()))) { var calendarId = calendarListEntry.Id; var calendarSummary = calendarListEntry.Summary; if (calendarIds.ContainsKey(calendarListEntry.Id)) { calendarId += calendarSummary; } calendarIds.Add(calendarId, calendarSummary); } return(calendarIds); }