// Token: 0x06001728 RID: 5928 RVA: 0x0008A6C0 File Offset: 0x000888C0
        public static IItem GetItem(Item xsoItem)
        {
            string  key    = EntitySyncItem.GetKey(xsoItem.Session.MailboxGuid, xsoItem.Id.ObjectId);
            IEvents events = EntitySyncItem.GetEvents(xsoItem.Session, xsoItem.Id.ObjectId);

            return(events.Read(key, null));
        }
示例#2
0
        protected void DeleteItem(ISyncItemId syncItemId, CancelEventParameters parameters)
        {
            AirSyncDiagnostics.TraceInfo(ExTraceGlobals.RequestsTracer, this, "SyncCollection.DeleteItem");
            string key = EntitySyncItem.GetKey(base.StoreSession.MailboxGuid, (StoreId)syncItemId.NativeId);

            this.Events.Cancel(key, parameters, null);
            base.ItemIdMapping.Delete(new ISyncItemId[]
            {
                syncItemId
            });
        }
        private Command.ExecutionState ForwardUsingEntities(StoreObjectId smartId)
        {
            if (base.Occurrence != ExDateTime.MinValue)
            {
                base.ProtocolLogger.SetValue(ProtocolLoggerData.Error, "NoOccurrenceSupport");
                throw new AirSyncPermanentException(HttpStatusCode.BadRequest, StatusCode.ServerError, null, false);
            }
            if (this.CalendaringContainer == null)
            {
                this.CalendaringContainer = new CalendaringContainer(base.MailboxSession, null);
            }
            if (this.StoreSession == null)
            {
                this.StoreSession = base.MailboxSession;
            }
            string  key    = EntitySyncItem.GetKey(this.StoreSession.MailboxGuid, smartId);
            IEvents events = EntitySyncItem.GetEvents(this.CalendaringContainer, this.StoreSession, smartId);

            events.Forward(key, this.forwardEventParameters, null);
            return(Command.ExecutionState.Complete);
        }
示例#4
0
        // Token: 0x06000CE9 RID: 3305 RVA: 0x000459B0 File Offset: 0x00043BB0
        private bool Respond(StoreObjectId itemId, string requestId, MeetingResponseCommand.RequestNodeData response, bool usingLongId)
        {
            if (base.Version <= 141)
            {
                return(this.LegacyRespond(itemId, requestId, response.UserResponse, usingLongId));
            }
            if (response.RespondToEventParameters == null)
            {
                throw new InvalidOperationException("Response.RespondToEventParameters must not be null at this point.");
            }
            StoreObjectId storeObjectId = null;
            string        calendarId    = null;

            if (this.CalendaringContainer == null)
            {
                AirSyncDiagnostics.TraceDebug(ExTraceGlobals.RequestsTracer, this, "Set default CalendaringContainer");
                this.CalendaringContainer = new CalendaringContainer(base.MailboxSession, null);
            }
            if (this.MailboxGuid == Guid.Empty)
            {
                AirSyncDiagnostics.TraceDebug(ExTraceGlobals.RequestsTracer, this, "Set default MailboxGuid");
                this.MailboxGuid = base.MailboxSession.MailboxGuid;
            }
            string  key = EntitySyncItem.GetKey(this.MailboxGuid, itemId);
            IEvents events;

            if (itemId.ObjectType == StoreObjectType.CalendarItem || itemId.ObjectType == StoreObjectType.CalendarItemOccurrence || itemId.ObjectType == StoreObjectType.CalendarItemSeries)
            {
                storeObjectId = itemId;
                events        = EntitySyncItem.GetEvents(this.CalendaringContainer, base.MailboxSession, itemId);
            }
            else
            {
                if (itemId.ObjectType != StoreObjectType.MeetingRequest)
                {
                    this.AppendNonSuccessXmlNode(requestId, StatusCode.Sync_ProtocolVersionMismatch, response.UserResponse, "The item is not meeting-request or calendar item.", usingLongId);
                    base.ProtocolLogger.SetValue(ProtocolLoggerData.Error, "UnsupportedObjectType" + itemId.ObjectType);
                    return(false);
                }
                using (MeetingMessage meetingMessage = MeetingMessage.Bind(base.MailboxSession, itemId))
                {
                    if (meetingMessage == null)
                    {
                        this.AppendNonSuccessXmlNode(requestId, StatusCode.Sync_ProtocolVersionMismatch, response.UserResponse, "Cannot find the meeting-request as specified in the reqest.", usingLongId);
                        base.ProtocolLogger.SetValue(ProtocolLoggerData.Error, "ItemNotFound");
                        return(false);
                    }
                    using (CalendarItemBase correlatedItem = meetingMessage.GetCorrelatedItem())
                    {
                        if (meetingMessage == null)
                        {
                            this.AppendNonSuccessXmlNode(requestId, StatusCode.Sync_ProtocolVersionMismatch, response.UserResponse, "Cannot find the correlated meeitng item.", usingLongId);
                            base.ProtocolLogger.SetValue(ProtocolLoggerData.Error, "NullCalItemInMRCmd");
                            return(false);
                        }
                        storeObjectId = correlatedItem.Id.ObjectId;
                    }
                }
                response.RespondToEventParameters.MeetingRequestIdToBeDeleted = key;
                key    = EntitySyncItem.GetKey(this.MailboxGuid, storeObjectId);
                events = this.CalendaringContainer.Calendars.Default.Events;
            }
            try
            {
                events.Respond(key, response.RespondToEventParameters, null);
            }
            catch (LocalizedException ex)
            {
                this.AppendNonSuccessXmlNode(requestId, StatusCode.Sync_ProtocolError, response.UserResponse, ex.Message, usingLongId);
                base.ProtocolLogger.SetValue(ProtocolLoggerData.Error, "EntityRespondError");
                return(false);
            }
            if (storeObjectId != null)
            {
                MailboxSyncItemId mailboxSyncItemId = MailboxSyncItemId.CreateForNewItem(storeObjectId);
                if (this.CalendarItemIdMapping.Contains(mailboxSyncItemId))
                {
                    calendarId = this.CalendarItemIdMapping[mailboxSyncItemId];
                }
                else
                {
                    calendarId = this.CalendarItemIdMapping.Add(mailboxSyncItemId);
                    this.calendarSyncStateChangedFlag = true;
                }
            }
            this.AppendXmlNode(requestId, StatusCode.Success, calendarId, response.UserResponse, usingLongId);
            return(true);
        }