Exemple #1
0
        private async void removeCalButtonClick(object sender, RoutedEventArgs e)
        {
            if (EventsListView.SelectedItems.Count <= 0)
            {
                return;
            }

            CalendarEvent item = EventsListView.SelectedItem as CalendarEvent;

            CalendarEvents calEvents = await CalendarEvents.CreateCalendarInstance();

            await calEvents.DeleteCalendarEvent(item.Id);

            DisplayCalendarEventsForDay(System.Convert.ToDateTime(item.Start));
        }
Exemple #2
0
        private async void DisplayCalendarEventsForDay(DateTime day)
        {
            CalendarEvents calEvents = await CalendarEvents.CreateCalendarInstance();

            var calResult =
                from t in (await calEvents.GetCalendarEvents(day))
                group t by t.StartDateTime into g
                orderby g.Key
                select g;

            EventsInfoCollection.Source = calResult;

            CalendarTitleString       = string.Format("Your day on: {0}", day.ToString("d"));
            CalendarTitle.DataContext = CalendarTitleString;
        }
Exemple #3
0
        private async void DropSessionEnd(object sender, DragEventArgs e)
        {
            try
            {
                if (null != DraggedSession)
                {
                    CalendarEvents calEvents = await CalendarEvents.CreateCalendarInstance();

                    await calEvents.AddOrUpdateCalendarEvent(DraggedSession.ToCalendarEvent());

                    DisplayCalendarEventsForDay(System.Convert.ToDateTime(DraggedSession.Start));
                }
            }
            catch { }
        }
Exemple #4
0
        private async void addCalButtonClick(object sender, RoutedEventArgs e)
        {
            if (SessionListView.SelectedItems.Count <= 0)
            {
                return;
            }

            Session item = SessionListView.SelectedItem as Session;

            CalendarEvents calEvents = await CalendarEvents.CreateCalendarInstance();

            CalendarEvent calendarEvent = item.ToCalendarEvent();
            await calEvents.AddOrUpdateCalendarEvent(calendarEvent);

            DisplayCalendarEventsForDay(System.Convert.ToDateTime(item.Start));
        }