Beispiel #1
0
        protected override void SetPropertiesInternal(DefaultFolderContext context, Folder folder)
        {
            base.SetPropertiesInternal(context, folder);
            SearchFolderCriteria searchFolderCriteria = null;
            SearchFolder         searchFolder         = (SearchFolder)folder;

            searchFolder[InternalSchema.ContainerClass] = "IPF.Task";
            int num = 786432;

            searchFolder[InternalSchema.ExtendedFolderToDoVersion] = num;
            searchFolder.Save();
            searchFolder.Load(null);
            try
            {
                searchFolderCriteria = searchFolder.GetSearchCriteria();
            }
            catch (ObjectNotInitializedException arg)
            {
                ExTraceGlobals.DefaultFoldersTracer.TraceDebug <string, ObjectNotInitializedException>((long)this.GetHashCode(), "ToDoSearchValidation::SetPropertiesInternal. Failed to get search criteria on the folder with name {0} due to {1}. It can be normal though for a search folder without search criteria applied yet.", searchFolder.DisplayName, arg);
            }
            if (searchFolderCriteria == null || !ToDoSearchValidation.MatchedToDoSearchCriteriaApproxly(searchFolderCriteria))
            {
                ExTraceGlobals.DefaultFoldersTracer.TraceDebug <string, SearchFolderCriteria, SearchFolderCriteria>((long)this.GetHashCode(), "ToDoSearchValidation::SetPropertiesInternal. Apply ToDo search criteria on the folder. DisplayName = {0}, currentCriteria = {1}, newCriteria = {2}.", searchFolder.DisplayName, searchFolderCriteria, ToDoSearchValidation.GetToDoSearchCriteria(context));
                searchFolder.ApplyContinuousSearch(ToDoSearchValidation.GetToDoSearchCriteria(context));
            }
        }
Beispiel #2
0
        protected override void SetPropertiesInternal(DefaultFolderContext context, Folder folder)
        {
            base.SetPropertiesInternal(context, folder);
            SearchFolder searchFolder = (SearchFolder)folder;

            searchFolder.Save();
            searchFolder.ApplyContinuousSearch(CalendarVersionStoreValidation.CreateCalendarVersionSearchCriteria(context));
            searchFolder.Load();
        }
Beispiel #3
0
        protected override void SetPropertiesInternal(DefaultFolderContext context, Folder folder)
        {
            base.SetPropertiesInternal(context, folder);
            SearchFolder searchFolder = (SearchFolder)folder;

            searchFolder.Save();
            searchFolder.Load(null);
            searchFolder.ApplyContinuousSearch(RemindersSearchFolderValidation.CreateRemindersSearchCriteria(context));
        }
Beispiel #4
0
        protected override void SetPropertiesInternal(DefaultFolderContext context, Folder folder)
        {
            base.SetPropertiesInternal(context, folder);
            SearchFolder searchFolder = (SearchFolder)folder;

            searchFolder.Save();
            searchFolder.Load(null);
            AllItemsFolderHelper.InitializeTransportIndexes(folder);
            AllItemsFolderValidation.TryApplyContinuousSearch(searchFolder, AllItemsFolderValidation.CreateSearchCriteria(context));
        }
        private static void UpdateFilteredViewSearchFolder(MailboxSession mailboxSession, SearchFolder searchFolder, OwaSearchContext searchContext)
        {
            ExTraceGlobals.StorageTracer.TraceDebug <string, OwaViewFilter>(0L, "[OwaFilterState::UpdateFilteredViewSearchFolder] updating search folder: {0} for filter: {1}", searchContext.ClientSearchFolderIdentity, searchContext.ViewFilter);
            searchFolder[FolderSchema.SearchFolderAllowAgeout]             = true;
            searchFolder[OwaFilteredViewProperties.FilteredViewLabel]      = OwaFilterState.GetPropertyValueToSave(mailboxSession, searchContext.FolderIdToSearch, searchContext.ViewFilter, searchContext.FromFilter);
            searchFolder[OwaFilteredViewProperties.FilteredViewAccessTime] = ExDateTime.Now;
            int folderProperty = OwaFilterState.GetFolderProperty <int>(searchFolder, FolderSchema.ExtendedFolderFlags, 0);

            searchFolder[FolderSchema.ExtendedFolderFlags] = (folderProperty | 4194304);
            searchFolder.Save();
            searchFolder.Load();
        }
        private static SearchFolder BindAndUpdateExistingFilteredViewSearchFolder(MailboxSession mailboxSession, OwaSearchContext searchContext)
        {
            SearchFolder searchFolder = OwaFilterState.BindExistingFilteredViewSearchFolder(searchContext.SearchFolderId, mailboxSession, searchContext);

            if (searchFolder != null)
            {
                string folderProperty = OwaFilterState.GetFolderProperty <string>(searchFolder, FolderSchema.DisplayName, string.Empty);
                ExTraceGlobals.StorageTracer.TraceDebug <string>(0L, "[OwaFilterState::BindAndUpdateExistingFilteredViewSearchFolder] Re-using existing filtered view search folder: {0}", folderProperty);
                searchContext.IsSearchFailed = !OwaFilterState.EnsureSearchIsCompleted(searchFolder, mailboxSession, searchContext);
                if (!searchContext.IsSearchFailed)
                {
                    searchFolder[OwaFilteredViewProperties.FilteredViewAccessTime] = ExDateTime.Now;
                    searchFolder.Save();
                    searchFolder.Load();
                    if ((searchContext.ViewFilterActions & ViewFilterActions.BindToExisting) == ViewFilterActions.None && OwaFilterState.LinkViewFolder(mailboxSession, searchContext.FolderIdToSearch, searchFolder, searchContext.ViewFilter))
                    {
                        searchContext.ViewFilterActions |= ViewFilterActions.LinkToSourceFolderSucceeded;
                    }
                }
            }
            return(searchFolder);
        }