internal static IEnumerable <StoreObjectId> GetSubfolders(IDiagnosticsSession tracer, Folder parentFolder, QueryFilter filter) { XsoUtil.< > c__DisplayClass6 CS$ < > 8__locals1 = new XsoUtil.< > c__DisplayClass6(); CS$ < > 8__locals1.parentFolder = parentFolder; CS$ < > 8__locals1.filter = filter; Util.ThrowOnNullArgument(CS$ < > 8__locals1.parentFolder, "parentFolder"); Guid mailboxGuid = CS$ < > 8__locals1.parentFolder.Session.MailboxGuid; using (QueryResult queryResult = XsoUtil.TranslateXsoExceptionsWithReturnValue <QueryResult>(tracer, Strings.ConnectionToMailboxFailed(mailboxGuid), () => CS$ < > 8__locals1.parentFolder.FolderQuery(FolderQueryFlags.DeepTraversal, CS$ < > 8__locals1.filter, null, new PropertyDefinition[] { FolderSchema.Id }))) { for (;;) { object[][] folders = XsoUtil.TranslateXsoExceptionsWithReturnValue <object[][]>(tracer, Strings.ConnectionToMailboxFailed(mailboxGuid), () => queryResult.GetRows(10000)); if (folders == null || folders.Length == 0) { break; } foreach (object[] folderProps in folders) { if (folderProps[0] != null && !PropertyError.IsPropertyError(folderProps[0])) { yield return(StoreId.GetStoreObjectId((StoreId)folderProps[0])); } } } } yield break; }
private void SubscribeForSearchComplete(OwaSearchContext searchContext) { ExTraceGlobals.NotificationsCallTracer.TraceDebug((long)this.GetHashCode(), "SearchNotificationHandler.SubscribeForSearchComplete Start"); if (base.IsDisposed) { return; } try { StoreObjectId storeObjectId = StoreId.GetStoreObjectId(searchContext.SearchFolderId); base.UserContext.LockAndReconnectMailboxSession(3000); if (base.Subscription != null) { MapiNotificationHandlerBase.DisposeXSOObjects(base.Subscription, base.UserContext); base.Subscription = null; } this.currentSearchContext = searchContext; base.Subscription = Subscription.Create(base.UserContext.MailboxSession, this.GetDefaultNotificationHandler(this.currentSearchContext), NotificationType.SearchComplete, storeObjectId); } catch (OwaLockTimeoutException ex) { ExTraceGlobals.CoreCallTracer.TraceError <string>((long)this.GetHashCode(), "User context lock timed out in SubscribeForSearchComplete. Exception: {0}", ex.Message); } finally { if (base.UserContext.MailboxSessionLockedByCurrentThread()) { base.UserContext.UnlockAndDisconnectMailboxSession(); } } }
private static bool ShouldEventBeUpdated(IBirthdayEventInternal birthdayEvent, IBirthdayContactInternal birthdayContact) { if (birthdayEvent == null) { throw new ArgumentNullException("birthdayEvent"); } if (birthdayContact == null) { throw new ArgumentNullException("birthdayContact"); } if (!birthdayEvent.ContactId.Equals(StoreId.GetStoreObjectId(birthdayContact.StoreId))) { throw new ArgumentException("Birthday event and birthday contact should have the same contact IDs", "birthdayEvent"); } bool flag = birthdayEvent.Subject != birthdayContact.DisplayName; bool flag2 = birthdayEvent.Birthday != birthdayContact.Birthday; bool flag3 = !birthdayEvent.PersonId.Equals(birthdayContact.PersonId); bool flag4 = birthdayEvent.Attribution != birthdayContact.Attribution; UpdateBirthdayEventForContact.UpdateBirthdayEventsForContactTracer.TraceDebug(0L, "Differences: subject - {0}, birthday - {1}, person ID - {2}, attribution - {3}", new object[] { flag, flag2, flag3, flag4 }); return(flag || flag2 || flag3 || flag4); }
public virtual string ToStringId(StoreId storeId, IStoreSession session) { if (session is IPublicFolderSession) { StoreObjectId parentFolderId = session.GetParentFolderId(StoreId.GetStoreObjectId(storeId)); return(StoreId.PublicFolderStoreIdToEwsId(storeId, parentFolderId)); } return(StoreId.StoreIdToEwsId(session.MailboxGuid, storeId)); }
public static void ValidateFolder(MailboxSession mailboxSession, StoreId sharingFolderId) { SharingEngine.GetADUser(mailboxSession); SharingEngine.GetSubscriptionData(mailboxSession, StoreId.GetStoreObjectId(sharingFolderId)); using (SharingEngine.BindToLocalFolder(mailboxSession, sharingFolderId)) { } SharingEngine.GetExternalAuthentication(mailboxSession); }
protected virtual IFolder BindToContainingFolder() { StoreObjectId storeObjectId = StoreId.GetStoreObjectId(this.ContainerFolderId); if (storeObjectId == null) { throw new InvalidRequestException(Strings.ErrorMissingRequiredParameter("ContainerFolderId")); } return(base.XsoFactory.BindToFolder(base.Session, storeObjectId)); }
public override void Delete(StoreId id, DeleteItemFlags flags) { base.Delete(id, flags); StoreObjectId storeObjectId = StoreId.GetStoreObjectId(id); if (storeObjectId is OccurrenceStoreObjectId) { this.TryLogCalendarEventActivity(ActivityId.UpdateCalendarEvent, storeObjectId); } }
internal virtual EventDataProvider GetDataProvider(StoreId storeId) { StoreObjectId storeObjectId = StoreId.GetStoreObjectId(storeId); if (storeObjectId.ObjectType != StoreObjectType.CalendarItemSeries) { return(this.EventDataProvider); } return(this.SeriesEventDataProvider); }
private void CacheInstanceId(HeaderList headers, StoreId instanceCalendarItemId) { Header header = headers.FindFirst("X-MS-Exchange-Calendar-Series-Instance-Calendar-Item-Id"); if (header == null) { header = Header.Create("X-MS-Exchange-Calendar-Series-Instance-Calendar-Item-Id"); headers.AppendChild(header); } header.Value = StoreId.GetStoreObjectId(instanceCalendarItemId).ToBase64String(); }
internal DeleteBirthdayEventForContact(IBirthdayContact contact, IBirthdayEvents scope) { this.Trace.TraceDebug((long)this.GetHashCode(), "DeleteBirthdayEventForContact:Constructor/contact"); IBirthdayContactInternal birthdayContactInternal = contact as IBirthdayContactInternal; if (birthdayContactInternal == null) { throw new ArgumentException("Contact has to implement IBirthdayContactInternal", "contact"); } this.ContactStoreObjectId = StoreId.GetStoreObjectId(birthdayContactInternal.StoreId); this.Scope = scope; }
byte[] IMailbox.GetReceiveFolderEntryId(string msgClass) { MrsTracer.Provider.Function("StorageMailbox.GetReceiveFolderEntryId", new object[0]); base.VerifyMailboxConnection(VerifyMailboxConnectionFlags.None); StoreObjectId receiveFolderId; using (base.RHTracker.Start()) { string text; receiveFolderId = this.GetMailboxSession().GetReceiveFolderId(msgClass, out text); } return(StoreId.GetStoreObjectId(receiveFolderId).ProviderLevelItemId); }
private static OriginalDeliveryFolderInfo GetOriginalDeliveryFolderInfo(StoreDriverDeliveryEventArgsImpl argsImpl) { StoreObjectId storeObjectId = argsImpl.MailboxSession.GetDefaultFolderId(DefaultFolderType.Inbox); if (argsImpl.DeliverToFolder != null) { StoreObjectId storeObjectId2 = StoreId.GetStoreObjectId(argsImpl.DeliverToFolder); if (storeObjectId2 != null && storeObjectId2.ProviderLevelItemId != null) { storeObjectId = storeObjectId2; } } return(InferenceXsoUtil.GetOriginalDeliveryFolderInfo(argsImpl.MailboxSession, storeObjectId)); }
private RuleEvaluationContext CreateEvaluationContext(StoreDriverDeliveryEventArgsImpl deliveryEventArguments) { MailboxSession mailboxSession = deliveryEventArguments.MailboxSession; string className = deliveryEventArguments.ReplayItem.ClassName; StoreObjectId storeObjectId = mailboxSession.GetDefaultFolderId(DefaultFolderType.Inbox); bool flag = deliveryEventArguments.DeliverToFolder != null; if (!string.IsNullOrEmpty(className)) { StoreObjectId receiveFolder = mailboxSession.GetReceiveFolder(className); if (receiveFolder != null && !receiveFolder.Equals(storeObjectId)) { deliveryEventArguments.ShouldRunMailboxRulesBasedOnDeliveryFolder = true; deliveryEventArguments.DeliverToFolder = receiveFolder; } } bool flag2 = false; if (deliveryEventArguments.ShouldRunMailboxRulesBasedOnDeliveryFolder && deliveryEventArguments.DeliverToFolder != null && !deliveryEventArguments.DeliverToFolder.Equals(storeObjectId)) { flag2 = true; storeObjectId = StoreId.GetStoreObjectId(deliveryEventArguments.DeliverToFolder); } bool processingTestMessage = this.testMessageConfig.ReportToAddress.IsValidAddress && (this.testMessageConfig.LogTypes & LogTypesEnum.InboxRules) != LogTypesEnum.None; long mimeStreamLength = deliveryEventArguments.MailItem.MimeStreamLength; Folder folder = null; RuleEvaluationContext ruleEvaluationContext = null; try { folder = Folder.Bind(mailboxSession, storeObjectId, RuleEvaluationContextBase.AdditionalFolderProperties); ruleEvaluationContext = RuleEvaluationContext.Create(this.server, folder, deliveryEventArguments.ReplayItem, mailboxSession, (string)deliveryEventArguments.MailRecipient.Email, deliveryEventArguments.ADRecipientCache, mimeStreamLength, processingTestMessage, this.testMessageConfig.ShouldExecuteDisabledAndInErrorRules, deliveryEventArguments.MailItemDeliver); ruleEvaluationContext.TraceDebug(string.Format("Initial folder name: {0}, ID: {1}, requested by previous agent: {2}, overridden by receive-folder table: {3}", new object[] { folder.DisplayName, folder.Id, flag, flag2 })); } finally { if (ruleEvaluationContext == null && folder != null) { folder.Dispose(); folder = null; } } return(ruleEvaluationContext); }
protected virtual bool TryGetSeriesMasterIdForPrInstance(IDictionary <Microsoft.Exchange.Data.PropertyDefinition, int> propertyIndices, IList values, IStoreSession session, out string seriesMasterId) { int index; object obj; if (propertyIndices.TryGetValue(ItemSchema.Id, out index) && (obj = values[index]) is StoreId) { StoreObjectId storeObjectId = StoreId.GetStoreObjectId((StoreId)obj); StoreObjectId storeId = StoreObjectId.FromProviderSpecificId(storeObjectId.ProviderLevelItemId, StoreObjectType.CalendarItem); seriesMasterId = this.IdConverter.ToStringId(storeId, session); return(true); } seriesMasterId = null; return(false); }
public int Process(bool markAsClutter, IConversationTree conversationTree, List <GroupOperationResult> results) { ArgumentValidator.ThrowIfNull("results", results); int num = 0; StoreObjectId storeObjectId = markAsClutter ? this.mailboxSession.GetDefaultFolderId(DefaultFolderType.Inbox) : this.mailboxSession.GetDefaultFolderId(DefaultFolderType.Clutter); StoreObjectId storeObjectId2 = markAsClutter ? this.mailboxSession.GetDefaultFolderId(DefaultFolderType.Clutter) : this.mailboxSession.GetDefaultFolderId(DefaultFolderType.Inbox); if (storeObjectId == null || storeObjectId2 == null) { return(num); } List <StoreObjectId> list = new List <StoreObjectId>(); foreach (IConversationTreeNode conversationTreeNode in conversationTree) { for (int i = 0; i < conversationTreeNode.StorePropertyBags.Count; i++) { StoreId id = conversationTreeNode.StorePropertyBags[i].TryGetProperty(ItemSchema.Id) as StoreId; if (storeObjectId.Equals(conversationTreeNode.StorePropertyBags[i].TryGetProperty(StoreObjectSchema.ParentItemId) as StoreObjectId)) { list.Add(StoreId.GetStoreObjectId(id)); } } } if (list.Count > 0) { try { using (Folder folder = Folder.Bind(this.mailboxSession, storeObjectId)) { using (Folder folder2 = Folder.Bind(this.mailboxSession, storeObjectId2)) { GroupOperationResult groupOperationResult = folder.MoveItems(folder2.Id, list.ToArray()); results.Add(groupOperationResult); if (groupOperationResult.OperationResult != OperationResult.Failed) { num += groupOperationResult.ObjectIds.Count; } } } } catch (LocalizedException storageException) { results.Add(new GroupOperationResult(OperationResult.Failed, list, storageException)); } } return(num); }
protected virtual StoreId ResolveCalendarFolderId() { StoreId storeId = base.GetStoreId(); StoreObjectId storeObjectId = StoreId.GetStoreObjectId(storeId); if (storeObjectId.IsFolderId) { return(storeId); } StoreId calendarId; using (ICalendarGroupEntry calendarGroupEntry = base.XsoFactory.BindToCalendarGroupEntry(base.StoreSession, storeObjectId)) { calendarId = calendarGroupEntry.CalendarId; } return(calendarId); }
private void ProcessFolderItems(Folder folder, MailboxSession sourceMailbox, MailboxSession targetMailbox, double maxProgress) { double mailboxProgress = this.searchWorker.MailboxProgress; int resultItemsCount = this.searchWorker.SearchResult.ResultItemsCount; using (QueryResult queryResult = folder.ItemQuery(ItemQueryType.None, null, new SortBy[] { new SortBy(StoreObjectSchema.ParentEntryId, SortOrder.Ascending) }, SearchResultProcessor.ItemPreloadProperties)) { while (!this.searchCommunicator.IsAborted) { this.BackOffFromSourceStore(); object[][] rows = queryResult.GetRows(this.batchedItemBuffer.Length); if (rows == null || rows.Length <= 0) { break; } for (int i = 0; i < rows.Length; i++) { this.ProcessSingleResult(rows[i]); this.searchWorker.SearchResult.ResultItemsCount++; StoreId storeId = (StoreId)rows[i][0]; StoreObjectId storeObjectId = StoreId.GetStoreObjectId(storeId); if (this.unsearchableItemSet != null && storeObjectId != null && this.unsearchableItemSet.Contains(storeObjectId)) { this.unsearchableItemSet.Remove(storeObjectId); } if (SearchResultProcessor.PropertyExists(rows[i][1])) { this.searchWorker.SearchResult.ResultItemsSize += (int)rows[i][1]; } else { SearchResultProcessor.Tracer.TraceDebug <StoreId>((long)this.GetHashCode(), "Unable to retrieve message size for message {0}", storeId); } int num = this.searchWorker.SearchResult.ResultItemsCount - resultItemsCount; double progress = this.CalcProgress(num, Math.Max(queryResult.EstimatedRowCount, num), mailboxProgress, maxProgress); this.UpdateProgress(progress, 10.0); } } } }
public virtual TStoreObject Bind(StoreId id) { StoreObjectId storeObjectId = StoreId.GetStoreObjectId(id); if (storeObjectId != null) { this.ValidateStoreObjectIdForCorrectType(storeObjectId); } TStoreObject result; try { result = this.BindToStoreObject(id); } catch (WrongObjectTypeException innerException) { throw new ObjectNotFoundException(Strings.ItemWithGivenIdNotFound(id.ToString()), innerException); } return(result); }
void IFolder.GetSearchCriteria(out RestrictionData restriction, out byte[][] entryIds, out SearchState state) { MrsTracer.Provider.Function("StorageFolder.GetSearchCriteria: {0}", new object[] { this.DisplayNameForTracing }); restriction = null; entryIds = null; state = SearchState.None; SearchFolderCriteria searchFolderCriteria = null; try { using (this.Mailbox.RHTracker.Start()) { searchFolderCriteria = this.CoreFolder.GetSearchCriteria(false); } } catch (ObjectNotInitializedException ex) { MrsTracer.Provider.Warning("GetSearchCriteria failed with ObjectNotInitializedException, ignoring.\n{0}", new object[] { CommonUtils.FullExceptionMessage(ex) }); } if (searchFolderCriteria != null) { state = (SearchState)searchFolderCriteria.SearchState; if (searchFolderCriteria.FolderScope != null) { entryIds = new byte[searchFolderCriteria.FolderScope.Length][]; for (int i = 0; i < searchFolderCriteria.FolderScope.Length; i++) { entryIds[i] = StoreId.GetStoreObjectId(searchFolderCriteria.FolderScope[i]).ProviderLevelItemId; } } restriction = RestrictionData.GetRestrictionData(this.Mailbox.StoreSession, searchFolderCriteria.SearchQuery); } }
private void CopyListToDictionary(IList <SyncCalendarItemType> items, string listName, Dictionary <ISyncItemId, ServerManifestEntry> newServerManifest) { AirSyncDiagnostics.TraceInfo <string, int>(ExTraceGlobals.RequestsTracer, this, "{0}:{1}", listName, items.Count); foreach (SyncCalendarItemType syncCalendarItemType in items) { EntitySyncWatermark watermark = null; object obj; if (syncCalendarItemType.RowData != null && syncCalendarItemType.RowData.TryGetValue(ItemSchema.ArticleId, out obj) && !(obj is PropertyError)) { watermark = EntitySyncWatermark.CreateWithChangeNumber((int)obj); } ISyncItemId syncItemId = EntitySyncItemId.CreateFromId(syncCalendarItemType.ItemId); ServerManifestEntry serverManifestEntry = new ServerManifestEntry(ChangeType.Add, syncItemId, watermark); serverManifestEntry.MessageClass = "IPM.APPOINTMENT"; serverManifestEntry.CalendarItemType = syncCalendarItemType.CalendarItemType; OccurrenceStoreObjectId occurrenceStoreObjectId = StoreId.GetStoreObjectId(syncCalendarItemType.ItemId) as OccurrenceStoreObjectId; if (occurrenceStoreObjectId != null) { serverManifestEntry.SeriesMasterId = occurrenceStoreObjectId.GetMasterStoreObjectId(); } newServerManifest.Add(syncItemId, serverManifestEntry); } }
private BirthdayEvent CreateNewBirthdayEventForContact(IBirthdayContact contact) { if (contact == null || contact.Birthday == null) { this.Trace.TraceDebug <IBirthdayContact>((long)this.GetHashCode(), "CreateBirthdayEventForContact::CreateNewBirthdayEvent: don't need to create a birthday for contact {0}", this.Contact); return(null); } ExDateTime value = contact.Birthday.Value; this.Trace.TraceDebug <ExDateTime, TimeSpan>((long)this.GetHashCode(), "CreateBirthdayEventForContact::CreateNewBirthdayEvent: birthday value is {0}, time zone bias is {1}", value, value.Bias); BirthdayEvent birthdayEvent = new BirthdayEvent { Birthday = value, Subject = contact.DisplayName, Attribution = contact.Attribution, IsWritable = contact.IsWritable }; IBirthdayEventInternal birthdayEventInternal = birthdayEvent; IBirthdayContactInternal birthdayContactInternal = (IBirthdayContactInternal)this.Contact; birthdayEventInternal.PersonId = birthdayContactInternal.PersonId; birthdayEventInternal.ContactId = StoreId.GetStoreObjectId(birthdayContactInternal.StoreId); return(this.Scope.BirthdayEventDataProvider.CreateBirthday(birthdayEvent)); }
public static ItemId GetItemId(IdAndSession idAndSession, StoreId storeId) { ConcatenatedIdAndChangeKey concatenatedIdAndChangeKey; if (idAndSession.Session is PublicFolderSession) { concatenatedIdAndChangeKey = IdConverter.GetConcatenatedIdForPublicFolderItem(storeId, StoreId.GetStoreObjectId(idAndSession.ParentFolderId), null); } else { concatenatedIdAndChangeKey = IdConverter.GetConcatenatedId(storeId, idAndSession, null); } return(new ItemId(concatenatedIdAndChangeKey.Id, concatenatedIdAndChangeKey.ChangeKey)); }
// Token: 0x06000F60 RID: 3936 RVA: 0x0003BCB8 File Offset: 0x00039EB8 private static ItemType GetItemFromDataRow(OwaSearchContext searchContext, MailboxSession mailboxSession, object[] row, Dictionary <PropertyDefinition, int> orderDictionary) { StoreId itemProperty = SearchFolderDataRetrieverBase.GetItemProperty <StoreId>(row, orderDictionary[ItemSchema.Id], null); StoreObjectId storeObjectId = StoreId.GetStoreObjectId(itemProperty); ItemType itemType = ItemType.CreateFromStoreObjectType(storeObjectId.ObjectType); itemType.ItemId = SearchFolderDataRetrieverBase.StoreIdToEwsItemId(itemProperty, new MailboxId(mailboxSession.MailboxGuid, false)); byte[] itemProperty2 = SearchFolderDataRetrieverBase.GetItemProperty <byte[]>(row, orderDictionary[ItemSchema.InstanceKey], new byte[0]); itemType.InstanceKey = itemProperty2; itemType.InstanceKeyString = Convert.ToBase64String(itemProperty2); itemType.ParentFolderId = new FolderId(SearchFolderDataRetrieverBase.GetEwsId(SearchFolderDataRetrieverBase.GetItemProperty <StoreId>(row, orderDictionary[StoreObjectSchema.ParentItemId], null), mailboxSession.MailboxGuid), null); itemType.ConversationId = new ItemId(IdConverter.ConversationIdToEwsId(mailboxSession.MailboxGuid, SearchFolderDataRetrieverBase.GetItemProperty <ConversationId>(row, orderDictionary[ItemSchema.ConversationId], null)), null); itemType.Subject = SearchFolderDataRetrieverBase.GetItemProperty <string>(row, orderDictionary[ItemSchema.Subject], string.Empty); itemType.ImportanceString = SearchFolderDataRetrieverBase.GetItemProperty <Importance>(row, orderDictionary[ItemSchema.Importance], Importance.Normal).ToString(); itemType.SensitivityString = SearchFolderDataRetrieverBase.GetItemProperty <Sensitivity>(row, orderDictionary[ItemSchema.Sensitivity], Sensitivity.Normal).ToString(); string dateTimeProperty = SearchFolderDataRetrieverBase.GetDateTimeProperty(searchContext.RequestTimeZone, row, orderDictionary[ItemSchema.ReceivedTime]); if (!string.IsNullOrEmpty(dateTimeProperty)) { itemType.DateTimeReceived = dateTimeProperty; } string dateTimeProperty2 = SearchFolderDataRetrieverBase.GetDateTimeProperty(searchContext.RequestTimeZone, row, orderDictionary[ItemSchema.SentTime]); if (!string.IsNullOrEmpty(dateTimeProperty2)) { itemType.DateTimeSent = dateTimeProperty2; } itemType.HasAttachments = new bool?(SearchFolderDataRetrieverBase.GetItemProperty <bool>(row, orderDictionary[ItemSchema.HasAttachment], false)); itemType.IsDraft = new bool?(SearchFolderDataRetrieverBase.GetItemProperty <bool>(row, orderDictionary[MessageItemSchema.IsDraft], false)); itemType.ItemClass = SearchFolderDataRetrieverBase.GetItemProperty <string>(row, orderDictionary[StoreObjectSchema.ItemClass], string.Empty); itemType.Preview = SearchFolderDataRetrieverBase.GetItemProperty <string>(row, orderDictionary[ItemSchema.Preview], string.Empty); MessageType messageType = itemType as MessageType; if (messageType != null) { Participant itemProperty3 = SearchFolderDataRetrieverBase.GetItemProperty <Participant>(row, orderDictionary[ItemSchema.From], null); if (itemProperty3 != null) { messageType.From = RowNotificationHandler.CreateRecipientFromParticipant(itemProperty3); } Participant itemProperty4 = SearchFolderDataRetrieverBase.GetItemProperty <Participant>(row, orderDictionary[ItemSchema.Sender], null); if (itemProperty4 != null) { messageType.Sender = RowNotificationHandler.CreateRecipientFromParticipant(itemProperty4); } messageType.IsRead = new bool?(SearchFolderDataRetrieverBase.GetItemProperty <bool>(row, orderDictionary[MessageItemSchema.IsRead], false)); } IconIndex itemProperty5 = SearchFolderDataRetrieverBase.GetItemProperty <IconIndex>(row, orderDictionary[ItemSchema.IconIndex], IconIndex.Default); if (itemProperty5 != IconIndex.Default) { itemType.IconIndexString = itemProperty5.ToString(); } FlagType flagType = new FlagType(); itemType.Flag = flagType; flagType.FlagStatus = SearchFolderDataRetrieverBase.GetItemProperty <FlagStatus>(row, orderDictionary[ItemSchema.FlagStatus], FlagStatus.NotFlagged); itemType.DateTimeCreated = SearchFolderDataRetrieverBase.GetDateTimeProperty(searchContext.RequestTimeZone, row, orderDictionary[StoreObjectSchema.CreationTime]); itemType.LastModifiedTime = SearchFolderDataRetrieverBase.GetDateTimeProperty(searchContext.RequestTimeZone, row, orderDictionary[StoreObjectSchema.LastModifiedTime]); itemType.Size = SearchFolderDataRetrieverBase.GetItemProperty <int?>(row, orderDictionary[ItemSchema.Size], null); itemType.DisplayTo = SearchFolderDataRetrieverBase.GetItemProperty <string>(row, orderDictionary[ItemSchema.DisplayTo], null); itemType.Categories = SearchFolderDataRetrieverBase.GetItemProperty <string[]>(row, orderDictionary[ItemSchema.Categories], null); return(itemType); }
// Token: 0x06000825 RID: 2085 RVA: 0x00039D49 File Offset: 0x00037F49 private static StoreObjectId ToStoreObjectId(object value) { return(StoreId.GetStoreObjectId((StoreId)value)); }
protected virtual IList <string> GetDeletedOccurrenceIds(Event master, ExDateTime windowStart, ExDateTime windowEnd) { List <string> list = new List <string>(); StoreId storeId = IdConverter.Instance.GetStoreId(master); using (ICalendarItemBase calendarItemBase = this.Scope.EventDataProvider.BindToStoreObject(storeId)) { CalendarItem calendarItem = calendarItemBase as CalendarItem; if (calendarItem != null && calendarItem.Recurrence != null) { ExDateTime[] deletedOccurrences = calendarItem.Recurrence.GetDeletedOccurrences(); foreach (ExDateTime exDateTime in deletedOccurrences) { ExDateTime endTime = exDateTime.Add(master.End.Subtract(master.Start)); if (CalendarFolder.IsInWindow(windowStart, windowEnd, exDateTime, endTime)) { OccurrenceStoreObjectId storeId2 = new OccurrenceStoreObjectId(StoreId.GetStoreObjectId(storeId).ProviderLevelItemId, exDateTime); list.Add(IdConverter.Instance.ToStringId(storeId2, this.Scope.Session)); } } } } return(list); }
protected override SubscribeResults InternalPerformSubscribe(MailboxSession mailboxSession, SharingContext context) { NetID netID = new NetID(context.MailboxId); long num = checked ((long)netID.ToUInt64()); if (num == 0L) { throw new InvalidOperationException("Invitation does not contain the owner ID."); } Guid guid; if (!Guid.TryParse(context.FolderEwsId, out guid)) { throw new InvalidOperationException("Invitation does not contain the calendar ID."); } using (Folder folder = Folder.Bind(mailboxSession, DefaultFolderType.Root)) { StoreObjectId defaultFolderId = mailboxSession.GetDefaultFolderId(DefaultFolderType.DeletedItems); QueryFilter queryFilter = QueryFilter.AndTogether(new QueryFilter[] { new ComparisonFilter(ComparisonOperator.Equal, CalendarFolderSchema.ConsumerCalendarGuid, guid), new ComparisonFilter(ComparisonOperator.Equal, CalendarFolderSchema.ConsumerCalendarOwnerId, num) }); using (IQueryResult queryResult = folder.IFolderQuery(FolderQueryFlags.DeepTraversal, queryFilter, null, new PropertyDefinition[] { FolderSchema.Id, FolderSchema.DisplayName, StoreObjectSchema.ParentItemId })) { bool flag = true; while (flag) { object[][] rows = queryResult.GetRows(100, out flag); if (rows == null || rows.Length == 0) { break; } foreach (object[] array2 in rows) { StoreObjectId storeObjectId = StoreId.GetStoreObjectId((StoreId)array2[2]); if (!defaultFolderId.Equals(storeObjectId)) { return(new SubscribeResults(context.DataType, context.InitiatorSmtpAddress, context.InitiatorName, context.FolderName, StoreId.GetStoreObjectId((StoreId)rows[0][0]), false, (string)rows[0][1])); } } } } } SubscribeResults result; using (CalendarFolder calendarFolder = CalendarFolder.Create(mailboxSession, mailboxSession.GetDefaultFolderId(DefaultFolderType.Root), StoreObjectType.CalendarFolder)) { calendarFolder[FolderSchema.ExtendedFolderFlags] = (ExtendedFolderFlags.SharedIn | ExtendedFolderFlags.ExclusivelyBound | ExtendedFolderFlags.ExchangeConsumerShareFolder); calendarFolder.DisplayName = (context.FolderName ?? context.InitiatorSmtpAddress); calendarFolder.ConsumerCalendarGuid = guid; calendarFolder.ConsumerCalendarOwnerId = num; calendarFolder.SaveWithUniqueDisplayName(50); calendarFolder.Load(); result = new SubscribeResults(context.DataType, context.InitiatorSmtpAddress, context.InitiatorName, context.FolderName, StoreId.GetStoreObjectId(calendarFolder.Id), true, calendarFolder.DisplayName); } return(result); }
private ItemType GetMessageItemFromNotification(QueryNotification notification) { ExTraceGlobals.NotificationsCallTracer.TraceDebug <string>((long)this.GetHashCode(), "[MessageItemRowNotificationHandler.GetMessageItemFromNotification] Start. SubscriptionId: {0}", base.SubscriptionId); ItemType itemType; if (notification.EventType == QueryNotificationType.RowDeleted) { itemType = new MessageType { InstanceKey = notification.Index }; } else { StoreId itemProperty = RowNotificationHandler.GetItemProperty <StoreId>(notification, Array.IndexOf <PropertyDefinition>(this.subscriptionProperties, ItemSchema.Id)); StoreObjectId storeObjectId = StoreId.GetStoreObjectId(itemProperty); itemType = ItemType.CreateFromStoreObjectType(storeObjectId.ObjectType); itemType.InstanceKey = notification.Index; itemType.ItemId = this.StoreIdToEwsItemId(itemProperty); itemType.ParentFolderId = new FolderId(base.GetEwsId(RowNotificationHandler.GetItemProperty <StoreId>(notification, Array.IndexOf <PropertyDefinition>(this.subscriptionProperties, StoreObjectSchema.ParentItemId))), null); itemType.ConversationId = new ItemId(IdConverter.ConversationIdToEwsId(base.MailboxGuid, RowNotificationHandler.GetItemProperty <ConversationId>(notification, Array.IndexOf <PropertyDefinition>(this.subscriptionProperties, ItemSchema.ConversationId))), null); itemType.Subject = RowNotificationHandler.GetItemProperty <string>(notification, Array.IndexOf <PropertyDefinition>(this.subscriptionProperties, ItemSchema.Subject)); itemType.ImportanceString = RowNotificationHandler.GetItemProperty <Importance>(notification, Array.IndexOf <PropertyDefinition>(this.subscriptionProperties, ItemSchema.Importance), Importance.Normal).ToString(); itemType.SensitivityString = RowNotificationHandler.GetItemProperty <Sensitivity>(notification, Array.IndexOf <PropertyDefinition>(this.subscriptionProperties, ItemSchema.Sensitivity), Sensitivity.Normal).ToString(); if (RowNotificationHandler.IsPropertyDefined(notification, Array.IndexOf <PropertyDefinition>(this.subscriptionProperties, ItemSchema.ReceivedTime))) { itemType.DateTimeReceived = base.GetDateTimeProperty(notification, Array.IndexOf <PropertyDefinition>(this.subscriptionProperties, ItemSchema.ReceivedTime)); } itemType.HasAttachments = new bool?(RowNotificationHandler.GetItemProperty <bool>(notification, Array.IndexOf <PropertyDefinition>(this.subscriptionProperties, ItemSchema.HasAttachment))); itemType.IsDraft = new bool?(RowNotificationHandler.GetItemProperty <bool>(notification, Array.IndexOf <PropertyDefinition>(this.subscriptionProperties, MessageItemSchema.IsDraft))); itemType.ItemClass = RowNotificationHandler.GetItemProperty <string>(notification, Array.IndexOf <PropertyDefinition>(this.subscriptionProperties, StoreObjectSchema.ItemClass)); MessageType messageType = itemType as MessageType; if (messageType != null) { if (RowNotificationHandler.IsPropertyDefined(notification, Array.IndexOf <PropertyDefinition>(this.subscriptionProperties, ItemSchema.From))) { messageType.From = RowNotificationHandler.CreateRecipientFromParticipant((Participant)notification.Row[Array.IndexOf <PropertyDefinition>(this.subscriptionProperties, ItemSchema.From)]); } if (RowNotificationHandler.IsPropertyDefined(notification, Array.IndexOf <PropertyDefinition>(this.subscriptionProperties, ItemSchema.Sender))) { messageType.Sender = RowNotificationHandler.CreateRecipientFromParticipant((Participant)notification.Row[Array.IndexOf <PropertyDefinition>(this.subscriptionProperties, ItemSchema.Sender)]); } messageType.IsRead = new bool?(RowNotificationHandler.GetItemProperty <bool>(notification, Array.IndexOf <PropertyDefinition>(this.subscriptionProperties, MessageItemSchema.IsRead))); } FlagType flagType = new FlagType(); if (RowNotificationHandler.IsPropertyDefined(notification, Array.IndexOf <PropertyDefinition>(this.subscriptionProperties, ItemSchema.CompleteDate))) { flagType.CompleteDate = base.GetDateTimeProperty(notification, Array.IndexOf <PropertyDefinition>(this.subscriptionProperties, ItemSchema.CompleteDate)); } if (RowNotificationHandler.IsPropertyDefined(notification, Array.IndexOf <PropertyDefinition>(this.subscriptionProperties, ItemSchema.FlagStatus))) { flagType.FlagStatus = RowNotificationHandler.GetItemProperty <FlagStatus>(notification, Array.IndexOf <PropertyDefinition>(this.subscriptionProperties, ItemSchema.FlagStatus), FlagStatus.NotFlagged); } if (RowNotificationHandler.IsPropertyDefined(notification, Array.IndexOf <PropertyDefinition>(this.subscriptionProperties, TaskSchema.StartDate))) { flagType.StartDate = base.GetDateTimeProperty(notification, Array.IndexOf <PropertyDefinition>(this.subscriptionProperties, TaskSchema.StartDate)); } if (RowNotificationHandler.IsPropertyDefined(notification, Array.IndexOf <PropertyDefinition>(this.subscriptionProperties, TaskSchema.DueDate))) { flagType.DueDate = base.GetDateTimeProperty(notification, Array.IndexOf <PropertyDefinition>(this.subscriptionProperties, TaskSchema.DueDate)); } itemType.Flag = flagType; if (RowNotificationHandler.IsPropertyDefined(notification, Array.IndexOf <PropertyDefinition>(this.subscriptionProperties, StoreObjectSchema.CreationTime))) { itemType.DateTimeCreated = base.GetDateTimeProperty(notification, Array.IndexOf <PropertyDefinition>(this.subscriptionProperties, StoreObjectSchema.CreationTime)); } if (RowNotificationHandler.IsPropertyDefined(notification, Array.IndexOf <PropertyDefinition>(this.subscriptionProperties, StoreObjectSchema.LastModifiedTime))) { itemType.LastModifiedTime = base.GetDateTimeProperty(notification, Array.IndexOf <PropertyDefinition>(this.subscriptionProperties, StoreObjectSchema.LastModifiedTime)); } if (RowNotificationHandler.IsPropertyDefined(notification, Array.IndexOf <PropertyDefinition>(this.subscriptionProperties, ItemSchema.ReceivedOrRenewTime))) { itemType.ReceivedOrRenewTime = base.GetDateTimeProperty(notification, Array.IndexOf <PropertyDefinition>(this.subscriptionProperties, ItemSchema.ReceivedOrRenewTime)); } itemType.Categories = RowNotificationHandler.GetItemProperty <string[]>(notification, Array.IndexOf <PropertyDefinition>(this.subscriptionProperties, ItemSchema.Categories)); itemType.Preview = RowNotificationHandler.GetItemProperty <string>(notification, Array.IndexOf <PropertyDefinition>(this.subscriptionProperties, ItemSchema.Preview), null); itemType.Size = RowNotificationHandler.GetItemProperty <int?>(notification, Array.IndexOf <PropertyDefinition>(this.subscriptionProperties, ItemSchema.Size), null); itemType.AddExtendedPropertyValue(new ExtendedPropertyType(WellKnownProperties.NormalizedSubject, RowNotificationHandler.GetItemProperty <string>(notification, Array.IndexOf <PropertyDefinition>(this.subscriptionProperties, MessageItemRowNotificationHandler.normalizedSubjectPropertyDefinition), null))); itemType.DisplayTo = RowNotificationHandler.GetItemProperty <string>(notification, Array.IndexOf <PropertyDefinition>(this.subscriptionProperties, ItemSchema.DisplayTo), null); if (RowNotificationHandler.IsPropertyDefined(notification, Array.IndexOf <PropertyDefinition>(this.subscriptionProperties, ItemSchema.IconIndex))) { IconIndex itemProperty2 = (IconIndex)RowNotificationHandler.GetItemProperty <int>(notification, Array.IndexOf <PropertyDefinition>(this.subscriptionProperties, ItemSchema.IconIndex)); if (itemProperty2 > (IconIndex)0) { itemType.IconIndexString = itemProperty2.ToString(); } } if (RowNotificationHandler.IsPropertyDefined(notification, Array.IndexOf <PropertyDefinition>(this.subscriptionProperties, ItemSchema.SentTime))) { itemType.DateTimeSent = base.GetDateTimeProperty(notification, Array.IndexOf <PropertyDefinition>(this.subscriptionProperties, ItemSchema.SentTime)); } if (RowNotificationHandler.IsPropertyDefined(notification, Array.IndexOf <PropertyDefinition>(this.subscriptionProperties, MessageItemRowNotificationHandler.lastVerbExecutedPropertyDefinition))) { itemType.AddExtendedPropertyValue(new ExtendedPropertyType(WellKnownProperties.LastVerbExecuted, RowNotificationHandler.GetItemProperty <int>(notification, Array.IndexOf <PropertyDefinition>(this.subscriptionProperties, MessageItemRowNotificationHandler.lastVerbExecutedPropertyDefinition)).ToString())); } if (RowNotificationHandler.IsPropertyDefined(notification, Array.IndexOf <PropertyDefinition>(this.subscriptionProperties, MessageItemRowNotificationHandler.lastVerbExecutionTimePropertyDefinition))) { itemType.AddExtendedPropertyValue(new ExtendedPropertyType(WellKnownProperties.LastVerbExecutionTime, base.GetDateTimeProperty(notification, Array.IndexOf <PropertyDefinition>(this.subscriptionProperties, MessageItemRowNotificationHandler.lastVerbExecutionTimePropertyDefinition)))); } ExTraceGlobals.NotificationsCallTracer.TraceDebug <string>((long)this.GetHashCode(), "[MessageItemRowNotificationHandler.GetMessageItemFromNotification] End. SubscriptionId: {0}", base.SubscriptionId); } return(itemType); }
// Token: 0x06000D64 RID: 3428 RVA: 0x00032724 File Offset: 0x00030924 private ConversationType GetConversationFromNotification(QueryNotification notification) { ExTraceGlobals.NotificationsCallTracer.TraceDebug <string>((long)this.GetHashCode(), "[ConversationRowNotificationHandler.GetConversationFromNotification] Start. SubscriptionId: {0}", base.SubscriptionId); ConversationType conv = new ConversationType(); conv.InstanceKey = notification.Index; if (notification.EventType != QueryNotificationType.RowDeleted) { conv.ConversationId = new ItemId(IdConverter.ConversationIdToEwsId(base.MailboxGuid, RowNotificationHandler.GetItemProperty <ConversationId>(notification, Array.IndexOf <PropertyDefinition>(this.conversationViewQuerySubscriptionProperties, ConversationItemSchema.ConversationId))), null); conv.ConversationTopic = RowNotificationHandler.GetItemProperty <string>(notification, Array.IndexOf <PropertyDefinition>(this.conversationViewQuerySubscriptionProperties, ConversationItemSchema.ConversationTopic)); conv.UniqueRecipients = RowNotificationHandler.GetItemProperty <string[]>(notification, Array.IndexOf <PropertyDefinition>(this.conversationViewQuerySubscriptionProperties, ConversationItemSchema.ConversationMVTo)); conv.UniqueSenders = RowNotificationHandler.GetItemProperty <string[]>(notification, Array.IndexOf <PropertyDefinition>(this.conversationViewQuerySubscriptionProperties, ConversationItemSchema.ConversationMVFrom)); conv.LastDeliveryTime = base.GetDateTimeProperty(notification, Array.IndexOf <PropertyDefinition>(this.conversationViewQuerySubscriptionProperties, ConversationItemSchema.ConversationLastDeliveryTime)); conv.LastDeliveryOrRenewTime = base.GetDateTimeProperty(notification, Array.IndexOf <PropertyDefinition>(this.conversationViewQuerySubscriptionProperties, ConversationItemSchema.ConversationLastDeliveryOrRenewTime)); conv.Categories = RowNotificationHandler.GetItemProperty <string[]>(notification, Array.IndexOf <PropertyDefinition>(this.conversationViewQuerySubscriptionProperties, ConversationItemSchema.ConversationCategories)); FlagType flagType = new FlagType(); if (RowNotificationHandler.IsPropertyDefined(notification, Array.IndexOf <PropertyDefinition>(this.conversationViewQuerySubscriptionProperties, ConversationItemSchema.ConversationFlagStatus))) { flagType.FlagStatus = (FlagStatus)RowNotificationHandler.GetItemProperty <int>(notification, Array.IndexOf <PropertyDefinition>(this.conversationViewQuerySubscriptionProperties, ConversationItemSchema.ConversationFlagStatus), 0); } conv.FlagStatus = flagType.FlagStatus; conv.HasAttachments = new bool?(RowNotificationHandler.GetItemProperty <bool>(notification, Array.IndexOf <PropertyDefinition>(this.conversationViewQuerySubscriptionProperties, ConversationItemSchema.ConversationHasAttach))); conv.HasIrm = new bool?(RowNotificationHandler.GetItemProperty <bool>(notification, Array.IndexOf <PropertyDefinition>(this.conversationViewQuerySubscriptionProperties, ConversationItemSchema.ConversationHasIrm))); conv.MessageCount = new int?(RowNotificationHandler.GetItemProperty <int>(notification, Array.IndexOf <PropertyDefinition>(this.conversationViewQuerySubscriptionProperties, ConversationItemSchema.ConversationMessageCount))); conv.GlobalMessageCount = new int?(RowNotificationHandler.GetItemProperty <int>(notification, Array.IndexOf <PropertyDefinition>(this.conversationViewQuerySubscriptionProperties, ConversationItemSchema.ConversationGlobalMessageCount))); conv.UnreadCount = new int?(RowNotificationHandler.GetItemProperty <int>(notification, Array.IndexOf <PropertyDefinition>(this.conversationViewQuerySubscriptionProperties, ConversationItemSchema.ConversationUnreadMessageCount))); conv.GlobalUnreadCount = new int?(RowNotificationHandler.GetItemProperty <int>(notification, Array.IndexOf <PropertyDefinition>(this.conversationViewQuerySubscriptionProperties, ConversationItemSchema.ConversationGlobalUnreadMessageCount))); conv.Size = new int?(RowNotificationHandler.GetItemProperty <int>(notification, Array.IndexOf <PropertyDefinition>(this.conversationViewQuerySubscriptionProperties, ConversationItemSchema.ConversationMessageSize))); conv.ItemClasses = RowNotificationHandler.GetItemProperty <string[]>(notification, Array.IndexOf <PropertyDefinition>(this.conversationViewQuerySubscriptionProperties, ConversationItemSchema.ConversationMessageClasses)); conv.ImportanceString = ((ImportanceType)RowNotificationHandler.GetItemProperty <int>(notification, Array.IndexOf <PropertyDefinition>(this.conversationViewQuerySubscriptionProperties, ConversationItemSchema.ConversationImportance), 1)).ToString(); StoreId[] itemProperty = RowNotificationHandler.GetItemProperty <StoreId[]>(notification, Array.IndexOf <PropertyDefinition>(this.conversationViewQuerySubscriptionProperties, ConversationItemSchema.ConversationItemIds), new StoreId[0]); conv.ItemIds = Array.ConvertAll <StoreId, ItemId>(itemProperty, (StoreId s) => new ItemId(base.GetEwsId(s), null)); StoreId[] itemProperty2 = RowNotificationHandler.GetItemProperty <StoreId[]>(notification, Array.IndexOf <PropertyDefinition>(this.conversationViewQuerySubscriptionProperties, ConversationItemSchema.ConversationGlobalItemIds), new StoreId[0]); conv.GlobalItemIds = Array.ConvertAll <StoreId, ItemId>(itemProperty2, (StoreId s) => new ItemId(base.GetEwsId(s), null)); conv.DraftStoreIds = from storeId in itemProperty2 where DraftItemIdsProperty.IsItemInDraftsFolder(storeId, this.draftFolderId) select StoreId.GetStoreObjectId(storeId); if (conv.DraftStoreIds.FirstOrDefault <StoreId>() != null) { SimulatedWebRequestContext.Execute(base.UserContext, "ConversationNotificationDraftItemIds", delegate(MailboxSession mailboxSession, IRecipientSession adSession, RequestDetailsLogger logger) { NormalQueryView.PrepareDraftItemIds(mailboxSession, new ConversationType[] { conv }); }); } conv.LastModifiedTime = base.GetDateTimeProperty(notification, Array.IndexOf <PropertyDefinition>(this.conversationViewQuerySubscriptionProperties, StoreObjectSchema.LastModifiedTime)); conv.Preview = RowNotificationHandler.GetItemProperty <string>(notification, Array.IndexOf <PropertyDefinition>(this.conversationViewQuerySubscriptionProperties, ConversationItemSchema.ConversationPreview)); conv.MailboxScopeString = MailboxSearchLocation.PrimaryOnly.ToString(); IconIndex itemProperty3 = (IconIndex)RowNotificationHandler.GetItemProperty <int>(notification, Array.IndexOf <PropertyDefinition>(this.conversationViewQuerySubscriptionProperties, ConversationItemSchema.ConversationReplyForwardState)); if (itemProperty3 > (IconIndex)0) { conv.IconIndexString = itemProperty3.ToString(); } itemProperty3 = (IconIndex)RowNotificationHandler.GetItemProperty <int>(notification, Array.IndexOf <PropertyDefinition>(this.conversationViewQuerySubscriptionProperties, ConversationItemSchema.ConversationGlobalReplyForwardState)); if (itemProperty3 > (IconIndex)0) { conv.GlobalIconIndexString = itemProperty3.ToString(); } this.LoadConversationFeedPropertiesIfRequested(notification, conv); ExTraceGlobals.NotificationsCallTracer.TraceDebug <string>((long)this.GetHashCode(), "[ConversationRowNotificationHandler.GetConversationFromNotification] End. SubscriptionId: {0}", base.SubscriptionId); } return(conv); }
public virtual Calendar Create(Calendar entity, ICalendarGroup calendarGroup) { this.Validate(entity, true); Calendar result; using (ICalendarGroupEntry calendarGroupEntry = base.XsoFactory.CreateCalendarGroupEntry(base.Session, StoreId.GetStoreObjectId(entity.CalendarFolderStoreId), calendarGroup)) { result = this.Update(entity, calendarGroupEntry, SaveMode.NoConflictResolution); } return(result); }
protected override VoidResult OnExecute() { StoreId entityStoreId = this.GetEntityStoreId(); EventDataProvider eventDataProvider = this.Scope.EventDataProvider; Event eventObject = eventDataProvider.Read(entityStoreId); this.Validate(eventObject); eventDataProvider.RespondToEvent(entityStoreId, base.Parameters, this.UpdateToEvent); this.Scope.EventDataProvider.TryLogCalendarEventActivity(ActivityId.UpdateCalendarEvent, StoreId.GetStoreObjectId(entityStoreId)); this.CleanUpDeclinedEvent(entityStoreId); this.DeleteMeetingRequestIfRequired(eventObject); return(VoidResult.Value); }