예제 #1
0
        private async Task convertAppointmentBuffer()
        {
            _pocalAppointmentsBuffer.Clear();
            await CalendarAPI.SetCalendars(false);

            foreach (var appt in _appoinmentBuffer)
            {
                var pocalAppt = await CreatePocalAppoinment(appt);

                _pocalAppointmentsBuffer.Add(pocalAppt);
            }
        }
예제 #2
0
        public async Task <PocalAppointment> CreatePocalAppoinment(Appointment appt)
        {
            var cal = CalendarAPI.Calendars.FirstOrDefault(c => c.LocalId == appt.CalendarId);

            if (cal == null)
            {
                await CalendarAPI.SetCalendars(true);

                cal = CalendarAPI.Calendars.First(c => c.LocalId == appt.CalendarId);
            }

            var pocalAppt = new PocalAppointment {
                Appt = appt, CalColor = getAppointmentColorBrush(appt, cal)
            };

            return(pocalAppt);
        }