Beispiel #1
0
        private StoreObjectId ResolveSearchFolderIdForFilteredView(StoreId inboxFolderId, OwaViewFilter viewFilter)
        {
            StoreObjectId storeObjectId = null;

            ExTraceGlobals.NotificationsCallTracer.TraceDebug <string>((long)this.GetHashCode(), "HierarchyNotificationHandler.ResolveSearchFolderIdForFilteredView Start. SubscriptionId: {0}", base.SubscriptionId);
            OwaSearchContext owaSearchContext = new OwaSearchContext();

            owaSearchContext.ViewFilter       = viewFilter;
            owaSearchContext.FolderIdToSearch = inboxFolderId;
            StoreObjectId defaultFolderId = base.UserContext.MailboxSession.GetDefaultFolderId(DefaultFolderType.SearchFolders);

            using (SearchFolder owaViewFilterSearchFolder = SearchUtil.GetOwaViewFilterSearchFolder(owaSearchContext, base.UserContext.MailboxSession, defaultFolderId, null, CallContext.Current))
            {
                if (owaViewFilterSearchFolder == null)
                {
                    throw new ArgumentNullException(string.Format("HierarchyNotificationHandler.ResolveSearchFolderIdForFilteredView null searchFolder returned for subscriptionId: {0}. ViewFilter: {1}; Source folder id: {2}", base.SubscriptionId, viewFilter, inboxFolderId.ToString()));
                }
                storeObjectId = owaViewFilterSearchFolder.StoreObjectId;
                ExTraceGlobals.NotificationsCallTracer.TraceDebug((long)this.GetHashCode(), "HierarchyNotificationHandler.ResolveSearchFolderIdForFilteredView found filtered-view search folder subscriptionId: {0} . ViewFilter: {1}; Source folder id: {2}, Search folder id: {3}", new object[]
                {
                    base.SubscriptionId,
                    viewFilter,
                    inboxFolderId.ToString(),
                    storeObjectId.ToString()
                });
            }
            return(storeObjectId);
        }
Beispiel #2
0
        // Token: 0x06000D22 RID: 3362 RVA: 0x0003109C File Offset: 0x0002F29C
        private void CreateSubscriptionForFilteredView()
        {
            ExTraceGlobals.NotificationsCallTracer.TraceDebug <string>((long)this.GetHashCode(), "RowNotificationHandler.CreateSubscriptionForFilteredView Start. SubscriptionId: {0}", base.SubscriptionId);
            OwaSearchContext owaSearchContext = new OwaSearchContext();

            owaSearchContext.ViewFilter       = (OwaViewFilter)SearchUtil.GetViewFilterForSearchFolder(this.viewFilter, this.clutterFilter);
            owaSearchContext.SearchFolderId   = this.searchFolderId;
            owaSearchContext.FolderIdToSearch = this.folderId;
            owaSearchContext.RequestTimeZone  = this.timeZone;
            owaSearchContext.FromFilter       = this.fromFilter;
            StoreObjectId defaultFolderId = base.UserContext.MailboxSession.GetDefaultFolderId(DefaultFolderType.SearchFolders);

            using (SearchFolder owaViewFilterSearchFolder = SearchUtil.GetOwaViewFilterSearchFolder(owaSearchContext, base.UserContext.MailboxSession, defaultFolderId, this.sortBy, CallContext.Current))
            {
                if (owaViewFilterSearchFolder == null)
                {
                    throw new ArgumentNullException(string.Format("RowNotificationHandler::CreateSubscriptionForFilteredView - null searchFolder returned for subscriptionId: {0}. ViewFilter: {1}; Source folder id: {2}", base.SubscriptionId, this.viewFilter, this.SubscriptionParameters.FolderId.ToString()));
                }
                ExTraceGlobals.NotificationsCallTracer.TraceDebug <string, ViewFilter, string>((long)this.GetHashCode(), "RowNotificationHandler.CreateSubscriptionForFilteredView create filtered view subscriptionId: {0} . ViewFilter: {1}; Source folder id: {2}", base.SubscriptionId, this.viewFilter, this.SubscriptionParameters.FolderId);
                this.searchFolderId = owaSearchContext.SearchFolderId;
                this.CreateSubscription(owaViewFilterSearchFolder);
            }
        }