Exemplo n.º 1
0
 ICalendarEvent CreateLockEvent(ICalendar calendar, string comment)
 {
     var eventName = String.IsNullOrEmpty(comment)
         ? "Shutdown Lock"
         : $"Shutdown Lock '{comment}'";
     try
     {
         return calendar.AddEvent(eventName, DateTime.Now, DateTime.Now + (s_LockInterval + s_LockInterval));
     }
     catch (CalendarException ex)
     {
         throw new LockManagerException("Error accessing calendar", ex);
     }
 }