Ejemplo n.º 1
0
        private void PopulateDynamicSearchFolder(SearchFolder searchFolder, SearchFolderCriteria searchCriteria)
        {
            IAsyncResult asyncResult = searchFolder.BeginApplyContinuousSearch(searchCriteria, null, null);
            bool         flag        = asyncResult.AsyncWaitHandle.WaitOne(SearchFolderManager.MaximumSearchTime, false);

            if (flag)
            {
                searchFolder.EndApplyContinuousSearch(asyncResult);
            }
            else
            {
                SearchFolderManager.Tracer.TraceDebug <SearchFolderManager>((long)this.GetHashCode(), "{0}: ELC Non Archive Tag search timed out.", this);
            }
            searchFolder.Save();
            searchFolder.Load();
        }
Ejemplo 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);
        }