protected override void ProcessRecord()
        {
            var config = GetConfiguration();
            var calendarFactory = new CalendarFactory();

            var calendars = config.Devices.Select(calendarFactory.GetCalendar);

            foreach (var calendar in  calendars)
            {
                calendar.ConnectToService();
            }
        }
Esempio n. 2
0
 ICalendar GetCalendar(IDeviceConfiguration device)
 {
     ICalendar calendar;
     try
     {
         var calendarFactory = new CalendarFactory();
         calendar = calendarFactory.GetCalendar(device.UptimeCalendarType, device.CalendarProviderSettingsDirectory, device.UptimeCalendarName);
     }
     catch (CalendarException ex)
     {
         throw new LockManagerException("Error accessing calendar", ex);
     }
     return calendar;
 }