コード例 #1
0
        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();
            }
        }
コード例 #2
0
ファイル: LockManager.cs プロジェクト: ap0llo/UptimeManager
 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;
 }