Ejemplo n.º 1
0
        private Event GetCalendarEventData(Activity activity, out IList <Event> exceptionalOccurrences, out IList <string> deletedOccurrences)
        {
            exceptionalOccurrences = null;
            deletedOccurrences     = null;
            Event result;

            try
            {
                StoreObjectId           storeObjectId           = activity.ItemId;
                OccurrenceStoreObjectId occurrenceStoreObjectId = storeObjectId as OccurrenceStoreObjectId;
                if (occurrenceStoreObjectId != null)
                {
                    storeObjectId = occurrenceStoreObjectId.GetMasterStoreObjectId();
                }
                string         text           = IdConverter.Instance.ToStringId(storeObjectId, this.mailboxSession);
                EventReference eventReference = new EventReference(XSOFactory.Default, this.mailboxSession, text);
                IEvents        events         = eventReference.Events;
                Event          @event         = events.Read(text, null);
                if (@event.PatternedRecurrence != null)
                {
                    ExpandedEvent expandedEvent = events.Expand(@event.Id, new ExpandEventParameters
                    {
                        ReturnExceptions    = true,
                        ReturnCancellations = true
                    }, null);
                    deletedOccurrences     = expandedEvent.CancelledOccurrences;
                    exceptionalOccurrences = this.FilterOutNonExceptionalProperties(expandedEvent.Occurrences);
                }
                result = @event;
            }
            catch (ObjectNotFoundException)
            {
                MrsTracer.Provider.Warning("StorageActionsSource.GetCalendarEventData unable to locate the event to replay.", new object[0]);
                result = null;
            }
            return(result);
        }