private IEnumerable <Calendar> FindAllCalendars() { CommandContext commandContext = new CommandContext(); commandContext.Expand = new string[] { "Calendars" }; CalendaringContainer calendaringContainer = new CalendaringContainer(this.Scope); IEnumerable <CalendarGroup> source = calendaringContainer.CalendarGroups.AsQueryable(commandContext).AsEnumerable <CalendarGroup>(); CalendarsInCalendarGroup calendarsInCalendarGroup = this.Scope as CalendarsInCalendarGroup; if (calendarsInCalendarGroup != null) { source = (from c in source where c.Id == calendarsInCalendarGroup.CalendarGroup.GetKey() select c).ToList <CalendarGroup>(); } return(source.SelectMany((CalendarGroup calendarGroup) => calendarGroup.Calendars)); }
public static void ProcessMeetingMessage(IStoreSession session, MeetingMessage message, Event @event, IXSOFactory xsoFactory = null) { try { MeetingMessageType type = message.Type; if (type != MeetingMessageType.SeriesRequest) { throw new NotSupportedException(string.Format("Not supported meeting message type: {0}", message.Type)); } ProcessMeetingMessageCommand processMeetingMessageCommand = new ProcessSeriesMeetingRequest { MeetingMessage = message, Event = @event }; CalendaringContainer calendaringContainer = new CalendaringContainer(session, xsoFactory); processMeetingMessageCommand.Scope = (calendaringContainer.Calendars.Default.Events as Events); processMeetingMessageCommand.Execute(null); } catch (Exception arg) { ExTraceGlobals.MeetingMessageProcessingTracer.TraceError <string, Exception>(0L, "Error processing meeting message for message '{0}'. Error {1}", message.Id ?? string.Empty, arg); throw; } }