public static string PublicFolderStoreIdToEwsId(StoreId storeId, StoreId parentFolderId) { Util.ThrowOnNullArgument(storeId, "storeId"); IdHeaderInformation idHeaderInformation = new IdHeaderInformation(); StoreObjectId storeObjectId = StoreId.GetStoreObjectId(storeId); if (storeObjectId.ObjectType == StoreObjectType.CalendarItemOccurrence) { idHeaderInformation.StoreIdBytes = storeObjectId.GetBytes(); idHeaderInformation.IdProcessingInstruction = IdProcessingInstruction.Recurrence; } else if (storeObjectId.ObjectType == StoreObjectType.CalendarItemSeries) { idHeaderInformation.StoreIdBytes = storeObjectId.ProviderLevelItemId; idHeaderInformation.IdProcessingInstruction = IdProcessingInstruction.Series; } else { idHeaderInformation.StoreIdBytes = storeObjectId.ProviderLevelItemId; idHeaderInformation.IdProcessingInstruction = IdProcessingInstruction.Normal; } if (Folder.IsFolderId(storeObjectId)) { idHeaderInformation.IdStorageType = IdStorageType.PublicFolder; } else { Util.ThrowOnNullArgument(parentFolderId, "parentFolderId"); StoreObjectId storeObjectId2 = StoreId.GetStoreObjectId(parentFolderId); idHeaderInformation.FolderIdBytes = storeObjectId2.ProviderLevelItemId; idHeaderInformation.IdStorageType = IdStorageType.PublicFolderItem; } return(ServiceIdConverter.ConvertToConcatenatedId(idHeaderInformation, null, true)); }
public static string StoreIdToEwsId(Guid mailboxGuid, StoreId storeId) { Util.ThrowOnNullArgument(storeId, "storeId"); MailboxId mailboxId = new MailboxId(mailboxGuid); IdHeaderInformation idHeaderInformation = new IdHeaderInformation(); StoreObjectId storeObjectId = StoreId.GetStoreObjectId(storeId); if (storeObjectId.ObjectType == StoreObjectType.CalendarItemOccurrence) { idHeaderInformation.StoreIdBytes = storeObjectId.GetBytes(); idHeaderInformation.IdProcessingInstruction = IdProcessingInstruction.Recurrence; } else if (storeObjectId.ObjectType == StoreObjectType.CalendarItemSeries) { idHeaderInformation.StoreIdBytes = storeObjectId.ProviderLevelItemId; idHeaderInformation.IdProcessingInstruction = IdProcessingInstruction.Series; } else { idHeaderInformation.StoreIdBytes = storeObjectId.ProviderLevelItemId; idHeaderInformation.IdProcessingInstruction = IdProcessingInstruction.Normal; } idHeaderInformation.IdStorageType = IdStorageType.MailboxItemMailboxGuidBased; idHeaderInformation.MailboxId = mailboxId; return(ServiceIdConverter.ConvertToConcatenatedId(idHeaderInformation, null, true)); }