Exemplo n.º 1
0
        protected override void InternalValidate()
        {
            this.itemId   = null;
            this.objectId = null;
            LocalizedString?localizedString = null;

            TaskLogger.LogEnter();
            base.InternalValidate();
            if (!string.IsNullOrEmpty(this.MeetingID))
            {
                try
                {
                    this.itemId = StoreObjectId.Deserialize(this.MeetingID);
                }
                catch (Exception)
                {
                    if (!GlobalObjectId.TryParse(this.MeetingID, out this.objectId))
                    {
                        base.WriteError(new ManagementObjectNotFoundException(localizedString ?? base.GetErrorMessageObjectNotFound(this.Identity.ToString(), typeof(MailboxIdParameter).ToString(), (base.DataSession != null) ? base.DataSession.Source : null)), ErrorCategory.InvalidData, null);
                    }
                }
            }
            this.logSourceUser = base.GetDataObjects(this.Identity, base.OptionalIdentityData, out localizedString).FirstOrDefault <ADUser>();
            if (this.logSourceUser == null || base.HasErrors)
            {
                base.WriteError(new ManagementObjectNotFoundException(localizedString ?? base.GetErrorMessageObjectNotFound(this.Identity.ToString(), typeof(MailboxIdParameter).ToString(), (base.DataSession != null) ? base.DataSession.Source : null)), ErrorCategory.InvalidData, null);
            }
            if (this.LogMailbox != null)
            {
                this.outputMailboxUser = base.GetDataObjects(this.LogMailbox, base.OptionalIdentityData, out localizedString).FirstOrDefault <ADUser>();
            }
            TaskLogger.LogExit();
        }
Exemplo n.º 2
0
        private static StoreObjectId CreateStoreObjectId(string storeObjectIdString)
        {
            if (storeObjectIdString == null)
            {
                throw new ArgumentNullException("storeObjectIdString");
            }
            StoreObjectId result = null;

            try
            {
                result = StoreObjectId.Deserialize(storeObjectIdString);
            }
            catch (ArgumentException innerException)
            {
                OwaStoreObjectId.ThrowInvalidIdFormatException(storeObjectIdString, null, innerException);
            }
            catch (FormatException innerException2)
            {
                OwaStoreObjectId.ThrowInvalidIdFormatException(storeObjectIdString, null, innerException2);
            }
            catch (CorruptDataException innerException3)
            {
                OwaStoreObjectId.ThrowInvalidIdFormatException(storeObjectIdString, null, innerException3);
            }
            return(result);
        }
        private MailboxAssociation GetAssociationByItemId(BaseAssociationAdaptor associationAdaptor, string base64ItemId)
        {
            MailboxAssociationContext.Tracer.TraceDebug <string>((long)this.GetHashCode(), "MailboxAssociationContext.GetAssociationByItemId [{0}]: Querying association by item id parameter", this.cmdletName);
            StoreObjectId itemId  = StoreObjectId.Deserialize(base64ItemId);
            VersionedId   itemId2 = new VersionedId(itemId, new byte[0]);

            return(associationAdaptor.GetAssociation(itemId2));
        }
Exemplo n.º 4
0
 public CalendarItemBaseData(CalendarItemBaseData other)
 {
     if (other.attachmentIds != null)
     {
         this.attachmentIds = new List <AttachmentId>();
         foreach (AttachmentId item in other.attachmentIds)
         {
             this.attachmentIds.Add(item);
         }
     }
     if (other.attendees != null)
     {
         this.attendees = new List <AttendeeData>();
         foreach (AttendeeData other2 in other.attendees)
         {
             this.attendees.Add(new AttendeeData(other2));
         }
     }
     this.bodyText         = other.bodyText;
     this.bodyFormat       = other.bodyFormat;
     this.calendarItemType = other.calendarItemType;
     this.endTime          = other.endTime;
     this.freeBusyStatus   = other.freeBusyStatus;
     try
     {
         if (other.folderId != null)
         {
             this.folderId = StoreObjectId.Deserialize(other.folderId.GetBytes());
         }
         if (other.id != null)
         {
             this.id = StoreObjectId.Deserialize(other.id.GetBytes());
         }
     }
     catch (ArgumentException)
     {
         throw new OwaInvalidRequestException("Invalid store object id");
     }
     catch (FormatException)
     {
         throw new OwaInvalidRequestException("Invalid store object id");
     }
     this.changeKey             = other.changeKey;
     this.importance            = other.importance;
     this.isAllDayEvent         = other.isAllDayEvent;
     this.isMeeting             = other.isMeeting;
     this.isOrganizer           = other.isOrganizer;
     this.isResponseRequested   = other.isResponseRequested;
     this.location              = other.location;
     this.meetingRequestWasSent = other.meetingRequestWasSent;
     this.organizer             = other.organizer;
     this.parentId              = other.parentId;
     this.sensitivity           = other.sensitivity;
     this.startTime             = other.startTime;
     this.subject = other.subject;
 }
        // Token: 0x060001CA RID: 458 RVA: 0x000111AC File Offset: 0x0000F3AC
        private static CalendarItemData CreateCalendarItemDataFromRequest(HttpRequest request, UserContext userContext)
        {
            CalendarItemData calendarItemData = new CalendarItemData();
            string           formParameter    = Utilities.GetFormParameter(request, "hidid");
            string           formParameter2   = Utilities.GetFormParameter(request, "hidfid");

            try
            {
                if (!string.IsNullOrEmpty(formParameter))
                {
                    calendarItemData.Id = StoreObjectId.Deserialize(formParameter);
                }
                else
                {
                    calendarItemData.Id = null;
                }
                if (!string.IsNullOrEmpty(formParameter2))
                {
                    calendarItemData.FolderId = StoreObjectId.Deserialize(formParameter2);
                }
                else
                {
                    calendarItemData.FolderId = null;
                }
            }
            catch (ArgumentException)
            {
                throw new OwaInvalidRequestException("Invalid store object id");
            }
            catch (FormatException)
            {
                throw new OwaInvalidRequestException("Invalid store object id");
            }
            ExDateTime startDate        = CalendarUtilities.ParseDateTimeFromForm(request, "selSY", "selSM", "selSD", null, userContext);
            TimeSpan   value            = CalendarUtilities.ParseTimeFromForm(request, "sttm");
            int        intValueFromForm = RequestParser.GetIntValueFromForm(request, "drtn");

            calendarItemData.StartTime = startDate.Add(value);
            calendarItemData.EndTime   = calendarItemData.StartTime.AddMinutes((double)intValueFromForm);
            if (calendarItemData.EndTime < calendarItemData.StartTime)
            {
                calendarItemData.EndTime = calendarItemData.StartTime.AddHours(1.0);
            }
            calendarItemData.Subject    = Utilities.GetFormParameter(request, "hidsubj", false);
            calendarItemData.Location   = Utilities.GetFormParameter(request, "hidloc", false);
            calendarItemData.Recurrence = EditRecurrencePreFormAction.CreateRecurrenceFromRequest(request, startDate, userContext);
            if (calendarItemData.Recurrence != null)
            {
                calendarItemData.IsAllDayEvent = Utilities.IsAllDayEvent(calendarItemData.StartTime, calendarItemData.EndTime);
            }
            return(calendarItemData);
        }
        private CalendarLogAnalysis LoadFromMailbox(CalendarLogId id, UriHandler handler, MailboxSession session)
        {
            StoreObjectId       storeId = StoreObjectId.Deserialize(handler.Id);
            CalendarLogAnalysis result;

            using (Item item = Item.Bind(session, storeId))
            {
                IEnumerable <PropertyDefinition> displayProperties = AnalysisDetailLevels.GetDisplayProperties(this.detailLevel);
                item.Load(displayProperties.ToArray <PropertyDefinition>());
                result = new CalendarLogAnalysis(id, item, displayProperties);
            }
            return(result);
        }
        public MailboxFolderIdParameter(string mailboxFolderId)
        {
            if (string.IsNullOrEmpty(mailboxFolderId))
            {
                throw new ArgumentNullException("mailboxFolderId");
            }
            this.rawIdentity = mailboxFolderId;
            int num = mailboxFolderId.IndexOf(':');

            if (-1 == num)
            {
                this.RawOwner      = new MailboxIdParameter(mailboxFolderId);
                this.RawFolderPath = MapiFolderPath.IpmSubtreeRoot;
                return;
            }
            string text  = mailboxFolderId.Substring(0, num);
            string text2 = mailboxFolderId.Substring(1 + num);

            if (!string.IsNullOrEmpty(text))
            {
                this.RawOwner = new MailboxIdParameter(text);
            }
            if (string.IsNullOrEmpty(text2))
            {
                throw new FormatException(Strings.ErrorInvalidMailboxFolderIdentity(this.rawIdentity));
            }
            try
            {
                if (text2[0] == '\\' || text2[0] == '￾')
                {
                    this.RawFolderPath = MapiFolderPath.Parse(text2);
                }
                else
                {
                    this.RawFolderStoreId = StoreObjectId.Deserialize(text2);
                }
            }
            catch (FormatException innerException)
            {
                throw new FormatException(Strings.ErrorInvalidMailboxFolderIdentity(this.rawIdentity), innerException);
            }
            catch (CorruptDataException innerException2)
            {
                throw new FormatException(Strings.ErrorInvalidMailboxFolderIdentity(this.rawIdentity), innerException2);
            }
        }
Exemplo n.º 8
0
        private static StoreObjectId GetItemId(string item)
        {
            StoreObjectId result;

            try
            {
                result = StoreObjectId.Deserialize(item);
            }
            catch (ArgumentException innerException)
            {
                throw new FormatException("Invalid Attachment StoreObjectId format: " + item, innerException);
            }
            catch (CorruptDataException innerException2)
            {
                throw new FormatException("Invalid Attachment StoreObjectId format: " + item, innerException2);
            }
            return(result);
        }
Exemplo n.º 9
0
        public Participant ToParticipant()
        {
            if (!string.IsNullOrEmpty(this.itemId))
            {
                if (this.addressOrigin == AddressOrigin.Directory)
                {
                    this.adObjectId = new ADObjectId(Convert.FromBase64String(this.itemId));
                }
                else if (this.addressOrigin == AddressOrigin.Store)
                {
                    this.storeObjectId = StoreObjectId.Deserialize(this.itemId);
                }
            }
            Participant result = null;

            Utilities.CreateExchangeParticipant(out result, this.displayName, this.routingAddress, this.routingType, this.addressOrigin, this.storeObjectId, this.emailAddressIndex);
            return(result);
        }
Exemplo n.º 10
0
 // Token: 0x06000C41 RID: 3137 RVA: 0x000409E4 File Offset: 0x0003EBE4
 public void Execute()
 {
     if (this.longId != null)
     {
         try
         {
             this.storeObjectId = StoreObjectId.Deserialize(HttpUtility.UrlDecode(this.longId));
             return;
         }
         catch (ArgumentException innerException)
         {
             throw new AirSyncPermanentException(StatusCode.Sync_ProtocolVersionMismatch, innerException, false)
                   {
                       ErrorStringForProtocolLogger = "BadLongIdArgInMbxFetch"
                   };
         }
         catch (FormatException innerException2)
         {
             throw new AirSyncPermanentException(StatusCode.Sync_ProtocolVersionMismatch, innerException2, false)
                   {
                       ErrorStringForProtocolLogger = "BadLongIdFmtInMbxFetch"
                   };
         }
         catch (CorruptDataException innerException3)
         {
             throw new AirSyncPermanentException(StatusCode.Sync_ClientServerConversion, innerException3, false)
                   {
                       ErrorStringForProtocolLogger = "CorruptLongIdInMbxFetch"
                   };
         }
     }
     this.storeObjectId = this.GetStoreObjectId(this.collectionId, this.serverId);
     if (this.storeObjectId == null)
     {
         throw new AirSyncPermanentException(StatusCode.Sync_ClientServerConversion, false)
               {
                   ErrorStringForProtocolLogger = "NotFoundIdInMbxFetch"
               };
     }
 }
        // Token: 0x06000C1F RID: 3103 RVA: 0x000263F4 File Offset: 0x000245F4
        public MailboxStoreObjectIdParameter(string id)
        {
            if (string.IsNullOrEmpty(id))
            {
                throw new ArgumentNullException("mailMessageId");
            }
            this.rawIdentity = id;
            int    num = id.LastIndexOf('\\');
            string text;

            if (-1 == num)
            {
                text = id;
            }
            else
            {
                string text2 = id.Substring(0, num);
                text = id.Substring(1 + num);
                if (!string.IsNullOrEmpty(text2))
                {
                    this.RawOwner = new MailboxIdParameter(text2);
                }
                if (string.IsNullOrEmpty(text))
                {
                    throw new FormatException(Strings.ErrorInvalidMailboxStoreObjectIdentity(this.rawIdentity));
                }
            }
            try
            {
                this.RawStoreObjectId = StoreObjectId.Deserialize(text);
            }
            catch (FormatException innerException)
            {
                throw new FormatException(Strings.ErrorInvalidMailboxStoreObjectIdentity(this.rawIdentity), innerException);
            }
            catch (CorruptDataException innerException2)
            {
                throw new FormatException(Strings.ErrorInvalidMailboxStoreObjectIdentity(this.rawIdentity), innerException2);
            }
        }
Exemplo n.º 12
0
 private StoreObjectId GetCachedCalendarItemIdFromHeaders(StoreDriverDeliveryEventArgsImpl args)
 {
     if (MeetingSeriesMessageOrderingAgent.SeriesMessageOrderingEnabled(args.MailboxOwner))
     {
         TextHeader textHeader = args.MailItem.Message.MimeDocument.RootPart.Headers.FindFirst("X-MS-Exchange-Calendar-Series-Instance-Calendar-Item-Id") as TextHeader;
         if (textHeader != null && !string.IsNullOrEmpty(textHeader.Value))
         {
             try
             {
                 return(StoreObjectId.Deserialize(textHeader.Value));
             }
             catch (FormatException arg)
             {
                 MeetingMessageProcessingAgent.tracer.TraceWarning <string, string, FormatException>((long)this.GetHashCode(), "Error deserializing cached calender item id from headers. Message {0}, mailbox {1}, error: {2}", args.MessageItem.InternetMessageId, args.MailboxSession.MailboxOwnerLegacyDN, arg);
             }
             catch (CorruptDataException arg2)
             {
                 MeetingMessageProcessingAgent.tracer.TraceWarning <string, string, CorruptDataException>((long)this.GetHashCode(), "Error deserializing cached calender item id from headers. Message {0}, mailbox {1}, error: {2}", args.MessageItem.InternetMessageId, args.MailboxSession.MailboxOwnerLegacyDN, arg2);
             }
         }
     }
     return(null);
 }
Exemplo n.º 13
0
 private string GetSubject(IFailureEntry failure, StoreSession session)
 {
     if (this.subjectRetrievalEnabled && session != null)
     {
         try
         {
             using (Item item = Item.Bind(session, StoreObjectId.Deserialize(failure.EntryId)))
             {
                 return((item.TryGetProperty(ItemSchema.Subject) as string) ?? string.Empty);
             }
         }
         catch (StoragePermanentException ex)
         {
             base.WriteWarning(ex.Message);
             return(string.Empty);
         }
         catch (StorageTransientException ex2)
         {
             base.WriteWarning(ex2.Message);
             return(string.Empty);
         }
     }
     return(string.Empty);
 }
Exemplo n.º 14
0
        // Token: 0x06001561 RID: 5473 RVA: 0x0007D91C File Offset: 0x0007BB1C
        protected StoreObjectId GetSmartItemId()
        {
            this.ParseXmlRequest();
            string          collectionId    = this.CollectionId;
            string          itemId          = this.ItemId;
            string          longId          = this.LongId;
            StoreObjectId   storeObjectId   = null;
            FolderSyncState folderSyncState = null;
            StoreObjectId   result;

            try
            {
                if (longId != null)
                {
                    if (base.Version < 120)
                    {
                        base.ProtocolLogger.SetValue(ProtocolLoggerData.Error, "LongIdSupportedinV12Only");
                        throw new AirSyncPermanentException(HttpStatusCode.BadRequest, StatusCode.InvalidCombinationOfIDs, null, false);
                    }
                    try
                    {
                        storeObjectId = StoreObjectId.Deserialize(longId);
                        goto IL_1F1;
                    }
                    catch (ArgumentException innerException)
                    {
                        base.ProtocolLogger.SetValue(ProtocolLoggerData.Error, "InvalidLongId");
                        throw new AirSyncPermanentException(HttpStatusCode.InternalServerError, StatusCode.InvalidIDs, innerException, false);
                    }
                    catch (FormatException innerException2)
                    {
                        base.ProtocolLogger.SetValue(ProtocolLoggerData.Error, "InvalidLongId2");
                        throw new AirSyncPermanentException(HttpStatusCode.InternalServerError, StatusCode.InvalidIDs, innerException2, false);
                    }
                    catch (CorruptDataException innerException3)
                    {
                        base.ProtocolLogger.SetValue(ProtocolLoggerData.Error, "InvalidLongId3");
                        throw new AirSyncPermanentException(HttpStatusCode.InternalServerError, StatusCode.InvalidIDs, innerException3, false);
                    }
                }
                if (collectionId == null)
                {
                    StoreObjectId defaultFolderId = base.MailboxSession.GetDefaultFolderId(DefaultFolderType.Inbox);
                    MailboxSyncProviderFactory syncProviderFactory = new MailboxSyncProviderFactory(base.MailboxSession, defaultFolderId);
                    folderSyncState = base.SyncStateStorage.GetFolderSyncState(syncProviderFactory);
                }
                else
                {
                    SyncCollection.CollectionTypes collectionType = AirSyncUtility.GetCollectionType(collectionId);
                    if (collectionType != SyncCollection.CollectionTypes.Mailbox && collectionType != SyncCollection.CollectionTypes.Unknown)
                    {
                        base.ProtocolLogger.SetValue(ProtocolLoggerData.Error, "SendFromVirtualFolder");
                        throw new AirSyncPermanentException(HttpStatusCode.BadRequest, StatusCode.InvalidCombinationOfIDs, null, false);
                    }
                    folderSyncState = base.SyncStateStorage.GetFolderSyncState(collectionId);
                }
                if (folderSyncState == null)
                {
                    base.ProtocolLogger.SetValue(ProtocolLoggerData.Error, "SyncStateNotFound");
                    throw new AirSyncPermanentException(HttpStatusCode.InternalServerError, StatusCode.SyncStateNotFound, null, false);
                }
                ItemIdMapping itemIdMapping = (ItemIdMapping)folderSyncState[CustomStateDatumType.IdMapping];
                if (itemIdMapping == null)
                {
                    base.ProtocolLogger.SetValue(ProtocolLoggerData.Error, "ItemIdMappingNotFound");
                    throw new AirSyncPermanentException(HttpStatusCode.InternalServerError, StatusCode.ItemNotFound, null, false);
                }
                MailboxSyncItemId mailboxSyncItemId = itemIdMapping[itemId] as MailboxSyncItemId;
                storeObjectId = ((mailboxSyncItemId == null) ? null : ((StoreObjectId)mailboxSyncItemId.NativeId));
                if (storeObjectId == null)
                {
                    base.ProtocolLogger.SetValue(ProtocolLoggerData.Error, "ItemIdMappingNotFound");
                    throw new AirSyncPermanentException(HttpStatusCode.InternalServerError, StatusCode.ItemNotFound, null, false);
                }
                folderSyncState.Dispose();
                folderSyncState = null;
IL_1F1:
                result = storeObjectId;
            }
            finally
            {
                if (folderSyncState != null)
                {
                    folderSyncState.Dispose();
                }
            }
            return(result);
        }
Exemplo n.º 15
0
        public static MdbCompositeItemIdentity Parse(string mdbComositeItemIdentity)
        {
            string[] array = mdbComositeItemIdentity.Split(new char[]
            {
                ','
            });
            if (array.Length != 5)
            {
                throw new ArgumentException(string.Format("The string representation of the Identity is invalid. {0}", mdbComositeItemIdentity));
            }
            string text = array[3];

            return(new MdbCompositeItemIdentity(new Guid(array[0]), new Guid(array[1]), int.Parse(array[2]), text.Equals(MdbCompositeItemIdentity.DummyStoreObjectId) ? StoreObjectId.DummyId : StoreObjectId.Deserialize(text), int.Parse(array[4])));
        }
Exemplo n.º 16
0
 // Token: 0x06000CE3 RID: 3299 RVA: 0x00044E4C File Offset: 0x0004304C
 internal void ProcessCommand()
 {
     foreach (MeetingResponseCommand.RequestNodeData requestNodeData in this.longIdRequests)
     {
         StoreObjectId storeObjectId = null;
         try
         {
             storeObjectId = StoreObjectId.Deserialize(HttpUtility.UrlDecode(requestNodeData.RequestId));
             if (requestNodeData.InstanceId != ExDateTime.MinValue)
             {
                 storeObjectId = this.GetOccurenceId(storeObjectId, requestNodeData.InstanceId);
             }
         }
         catch (ArgumentException)
         {
             base.ProtocolLogger.IncrementValue(ProtocolLoggerData.MRErrors);
             this.AppendNonSuccessXmlNode(requestNodeData.RequestId, StatusCode.Sync_ProtocolVersionMismatch, requestNodeData.UserResponse, string.Format(CultureInfo.InvariantCulture, "The LongId '{0}' in the reqest is invalid!", new object[]
             {
                 requestNodeData.RequestId
             }), true);
             base.ProtocolLogger.SetValue(ProtocolLoggerData.Error, "InvalidLongId");
             base.PartialFailure = true;
             continue;
         }
         catch (CorruptDataException)
         {
             base.ProtocolLogger.IncrementValue(ProtocolLoggerData.MRErrors);
             this.AppendNonSuccessXmlNode(requestNodeData.RequestId, StatusCode.Sync_ProtocolVersionMismatch, requestNodeData.UserResponse, string.Format(CultureInfo.InvariantCulture, "The LongId '{0}' in the reqest is invalid!", new object[]
             {
                 requestNodeData.RequestId
             }), true);
             base.ProtocolLogger.SetValue(ProtocolLoggerData.Error, "InvalidLongId2");
             base.PartialFailure = true;
             continue;
         }
         catch (FormatException)
         {
             base.ProtocolLogger.IncrementValue(ProtocolLoggerData.MRErrors);
             this.AppendNonSuccessXmlNode(requestNodeData.RequestId, StatusCode.Sync_ProtocolVersionMismatch, requestNodeData.UserResponse, string.Format(CultureInfo.InvariantCulture, "The LongId '{0}' in the reqest is invalid!", new object[]
             {
                 requestNodeData.RequestId
             }), true);
             base.ProtocolLogger.SetValue(ProtocolLoggerData.Error, "InvalidLongId3");
             base.PartialFailure = true;
             continue;
         }
         catch (AirSyncPermanentException ex)
         {
             base.ProtocolLogger.IncrementValue(ProtocolLoggerData.MRErrors);
             AirSyncDiagnostics.TraceDebug <string, string>(ExTraceGlobals.RequestsTracer, this, "Exception caught while processing LongId {0}\r\n{1}", requestNodeData.RequestId, ex.ToString());
             base.ProtocolLogger.SetValue(ProtocolLoggerData.Error, (!string.IsNullOrEmpty(ex.ErrorStringForProtocolLogger)) ? ex.ErrorStringForProtocolLogger : "InvalidLongId4");
             this.AppendNonSuccessXmlNode(requestNodeData.RequestId, ex.AirSyncStatusCode, requestNodeData.UserResponse, ex.ErrorStringForProtocolLogger, true);
             base.PartialFailure = true;
             continue;
         }
         try
         {
             if (!this.Respond(storeObjectId, requestNodeData.RequestId, requestNodeData, true))
             {
                 base.ProtocolLogger.IncrementValue(ProtocolLoggerData.MRErrors);
             }
         }
         catch (AirSyncPermanentException)
         {
             base.ProtocolLogger.IncrementValue(ProtocolLoggerData.MRErrors);
             base.PartialFailure = true;
             throw;
         }
     }
     foreach (string text in this.shortIdRequests.Keys)
     {
         IList <MeetingResponseCommand.RequestNodeData> list = this.shortIdRequests[text];
         using (FolderSyncState folderSyncState = base.SyncStateStorage.GetFolderSyncState(text))
         {
             for (int i = 0; i < list.Count; i++)
             {
                 try
                 {
                     string requestId = list[i].RequestId;
                     if (folderSyncState == null || folderSyncState[CustomStateDatumType.IdMapping] == null)
                     {
                         this.AppendNonSuccessXmlNode(list[i].RequestId, StatusCode.Sync_ProtocolVersionMismatch, list[i].UserResponse, string.Format(CultureInfo.InvariantCulture, "The CollectionId '{0}' in the reqest has not been synced yet.", new object[]
                         {
                             text
                         }), false);
                         base.ProtocolLogger.SetValue(ProtocolLoggerData.Error, "CollectionNotSynced");
                     }
                     else
                     {
                         StoreObjectId     storeObjectId2    = null;
                         MailboxSyncItemId mailboxSyncItemId = ((ItemIdMapping)folderSyncState[CustomStateDatumType.IdMapping])[requestId] as MailboxSyncItemId;
                         if (mailboxSyncItemId != null)
                         {
                             if (list[i].InstanceId == ExDateTime.MinValue)
                             {
                                 storeObjectId2 = (StoreObjectId)mailboxSyncItemId.NativeId;
                             }
                             else
                             {
                                 storeObjectId2 = this.GetOccurenceId((StoreObjectId)mailboxSyncItemId.NativeId, list[i].InstanceId);
                             }
                         }
                         if (storeObjectId2 == null)
                         {
                             this.AppendNonSuccessXmlNode(requestId, StatusCode.Sync_ProtocolVersionMismatch, list[i].UserResponse, string.Format(CultureInfo.InvariantCulture, "Cannot look up the meeting-request '{0}' from ItemIdMapping.", new object[]
                             {
                                 requestId
                             }), false);
                             base.ProtocolLogger.SetValue(ProtocolLoggerData.Error, "InvalidRequestId");
                         }
                         else if (!this.Respond(storeObjectId2, requestId, list[i], false))
                         {
                             base.ProtocolLogger.IncrementValue(ProtocolLoggerData.MRErrors);
                         }
                     }
                 }
                 catch (AirSyncPermanentException ex2)
                 {
                     base.ProtocolLogger.IncrementValue(ProtocolLoggerData.MRErrors);
                     AirSyncDiagnostics.TraceDebug <string, string>(ExTraceGlobals.RequestsTracer, this, "Exception caught while processing meeting-request {0}\r\n{1}", list[i].RequestId, ex2.ToString());
                     base.ProtocolLogger.SetValue(ProtocolLoggerData.Error, (!string.IsNullOrEmpty(ex2.ErrorStringForProtocolLogger)) ? ex2.ErrorStringForProtocolLogger : "InvalidLongId4");
                     this.AppendNonSuccessXmlNode(list[i].RequestId, ex2.AirSyncStatusCode, list[i].UserResponse, ex2.ErrorStringForProtocolLogger, false);
                     base.PartialFailure = true;
                 }
             }
         }
     }
 }
Exemplo n.º 17
0
 public virtual void SetFrom(CalendarItemBase calendarItemBase)
 {
     if (this.attachmentIds == null)
     {
         this.attachmentIds = new List <AttachmentId>();
     }
     else
     {
         this.attachmentIds.Clear();
     }
     if (this.attendees == null)
     {
         this.attendees = new List <AttendeeData>();
     }
     else
     {
         this.attendees.Clear();
     }
     if (calendarItemBase.AttachmentCollection != null)
     {
         foreach (AttachmentHandle handle in calendarItemBase.AttachmentCollection)
         {
             using (Attachment attachment = calendarItemBase.AttachmentCollection.Open(handle))
             {
                 if (attachment.Id == null)
                 {
                     throw new ArgumentNullException("attachment.Id");
                 }
                 this.attachmentIds.Add(attachment.Id);
             }
         }
     }
     if (calendarItemBase.Body != null)
     {
         this.bodyText   = ItemUtility.GetItemBody(calendarItemBase, BodyFormat.TextPlain);
         this.bodyFormat = BodyFormat.TextPlain;
     }
     this.calendarItemType = calendarItemBase.CalendarItemType;
     this.endTime          = calendarItemBase.EndTime;
     this.freeBusyStatus   = calendarItemBase.FreeBusyStatus;
     try
     {
         if (calendarItemBase.ParentId != null)
         {
             this.folderId = StoreObjectId.Deserialize(calendarItemBase.ParentId.GetBytes());
         }
         else
         {
             this.folderId = null;
         }
         if (calendarItemBase.Id != null && calendarItemBase.Id.ObjectId != null)
         {
             this.id = StoreObjectId.Deserialize(calendarItemBase.Id.ObjectId.GetBytes());
         }
         else
         {
             this.id = null;
         }
     }
     catch (ArgumentException)
     {
         throw new OwaInvalidRequestException("Invalid store object id");
     }
     catch (FormatException)
     {
         throw new OwaInvalidRequestException("Invalid store object id");
     }
     if (calendarItemBase.Id != null)
     {
         this.changeKey = calendarItemBase.Id.ChangeKeyAsBase64String();
     }
     else
     {
         this.changeKey = null;
     }
     this.importance            = calendarItemBase.Importance;
     this.isAllDayEvent         = calendarItemBase.IsAllDayEvent;
     this.isMeeting             = calendarItemBase.IsMeeting;
     this.isOrganizer           = calendarItemBase.IsOrganizer();
     this.isResponseRequested   = CalendarItemBaseData.GetIsResponseRequested(calendarItemBase);
     this.location              = calendarItemBase.Location;
     this.meetingRequestWasSent = calendarItemBase.MeetingRequestWasSent;
     this.organizer             = AttendeeData.CloneParticipant(calendarItemBase.Organizer);
     if (calendarItemBase.ParentId != null)
     {
         this.parentId = StoreObjectId.FromProviderSpecificId(calendarItemBase.ParentId.ProviderLevelItemId);
     }
     if (calendarItemBase.AttendeeCollection != null)
     {
         foreach (Attendee attendee in calendarItemBase.AttendeeCollection)
         {
             this.attendees.Add(new AttendeeData(attendee));
         }
     }
     this.sensitivity = calendarItemBase.Sensitivity;
     this.startTime   = calendarItemBase.StartTime;
     this.subject     = calendarItemBase.Subject;
 }
Exemplo n.º 18
0
 // Token: 0x0600170F RID: 5903 RVA: 0x0008A384 File Offset: 0x00088584
 public void SetCollectionIdFromBytes(byte[] collectionBytes)
 {
     this.folderId = StoreObjectId.Deserialize(collectionBytes);
 }
Exemplo n.º 19
0
 internal MigrationReportId(string reportId)
 {
     reportId = reportId.Replace('-', '+').Replace('_', '/');
     this.Id  = StoreObjectId.Deserialize(reportId);
 }