Exemplo n.º 1
0
        public virtual bool GetDidLastSearchFail()
        {
            if (!this.IsInSearch)
            {
                return(false);
            }
            if (this.didLastSearchFail != null)
            {
                return(this.didLastSearchFail.Value);
            }
            SearchFolder searchFolder = this.DataFolder as SearchFolder;

            if (searchFolder != null && this.UserContext.IsPushNotificationsEnabled)
            {
                bool flag2;
                bool flag = this.UserContext.MapiNotificationManager.HasCurrentSearchCompleted((MailboxSession)searchFolder.Session, searchFolder.StoreObjectId, out flag2);
                if (flag && flag2)
                {
                    this.didLastSearchFail = new bool?((searchFolder.GetSearchCriteria().SearchState & SearchState.Failed) != SearchState.None);
                }
                if (this.didLastSearchFail != null && this.didLastSearchFail == true)
                {
                    SearchPerformanceData searchPerformanceData = this.UserContext.MapiNotificationManager.GetSearchPerformanceData((MailboxSession)searchFolder.Session);
                    searchPerformanceData.SearchFailed();
                }
            }
            return(this.didLastSearchFail != null && this.didLastSearchFail.Value);
        }
Exemplo n.º 2
0
        // Token: 0x0600228D RID: 8845 RVA: 0x000C5B54 File Offset: 0x000C3D54
        public void ApplyFilter(SearchFolder folder, PropertyDefinition[] propertiesToLoad)
        {
            if (!this.IsCurrentVersion)
            {
                throw new OwaInvalidOperationException("Can't apply a filter in different version");
            }
            int num = 0;
            SearchFolderCriteria searchFolderCriteria = new SearchFolderCriteria(this.GetQueryFilter(), new StoreId[]
            {
                this.SourceFolderId.StoreObjectId
            });

            searchFolderCriteria.DeepTraversal = false;
            SearchPerformanceData searchPerformanceData = new SearchPerformanceData();
            string text = this.ToDescription();

            searchPerformanceData.StartSearch(string.IsNullOrEmpty(text) ? "No Search String" : text);
            IAsyncResult asyncResult = folder.BeginApplyContinuousSearch(searchFolderCriteria, null, null);
            Stopwatch    watch       = Utilities.StartWatch();
            bool         flag        = asyncResult.AsyncWaitHandle.WaitOne(5000, false);

            searchPerformanceData.Complete(!flag, true);
            if (flag)
            {
                folder.EndApplyContinuousSearch(asyncResult);
            }
            else
            {
                ExTraceGlobals.MailTracer.TraceDebug((long)this.GetHashCode(), "FolderVirtualListViewEventHandler.GetFilteredView. Search for filtered view timed out.");
                if (Globals.ArePerfCountersEnabled)
                {
                    OwaSingleCounters.SearchesTimedOut.Increment();
                }
            }
            OwaContext.Current.SearchPerformanceData = searchPerformanceData;
            Utilities.StopWatch(watch, "FolderVirtualListViewEventHandler.GetFilteredView (Wait for filter to complete)");
            object obj = folder.TryGetProperty(FolderSchema.ExtendedFolderFlags);

            if (!(obj is PropertyError))
            {
                num = (int)obj;
            }
            folder[FolderSchema.ExtendedFolderFlags] = (num | 4194304);
            folder.Save();
            folder.Load(propertiesToLoad);
        }