public static List <Calendar> GetCalendarsForAccount(CalendarAccount selectedAccount) { //create empty calendar list var calendarList = new List <Calendar>(); //based on calendar account use the right calendar list getter switch (selectedAccount) { case CalendarAccount.Google: calendarList = CalendarManager.GetCalendarListGoogle(); break; case CalendarAccount.iCloud: LogManager.Error("iCloud not supported atm!"); break; case CalendarAccount.Outlook: LogManager.Error("Outlook not supported atm!"); break; } //return possibly filed list to caller return(calendarList); }
public static void SendEventsToCalendar(List <Event> events, Calendar calendarName, CalendarAccount google, bool splitEvents, bool enableReminders, string customEventName) { //split events by day if checked if (splitEvents) { events = EventManager.SplitEventsByDay(events); } //pass thread canceler, so that sending can be stopped if needed CalendarManager.threadCanceler = threadCanceler; //start sending CalendarManager.AddEventsToCalenderGoogle(events, calendarName.Id, enableReminders, customEventName); //fire event to let others know event sending is done SendingEventsCompleted.Invoke(); }