Ejemplo n.º 1
0
        internal override bool EnsureIsValid(DefaultFolderContext context, Folder folder)
        {
            FromPeopleFolderValidation.Tracer.TraceFunction((long)this.GetHashCode(), "Entering FromPeopleFolderValidation.EnsureIsValid");
            if (!base.EnsureIsValid(context, folder))
            {
                FromPeopleFolderValidation.Tracer.TraceFunction((long)this.GetHashCode(), "Exiting FromPeopleFolderValidation.EnsureIsValid:  folder failed base class validation.");
                return(false);
            }
            SearchFolder searchFolder = folder as SearchFolder;

            if (searchFolder == null)
            {
                FromPeopleFolderValidation.Tracer.TraceFunction((long)this.GetHashCode(), "Exiting FromPeopleFolderValidation.Validate:  not a SearchFolder instance.");
                return(false);
            }
            SearchFolderCriteria searchFolderCriteria = SearchFolderValidation.TryGetSearchCriteria(searchFolder);
            SearchFolderCriteria searchCriteria       = FromPeopleFolderValidation.GetSearchCriteria(context);

            if (searchFolderCriteria == null || !SearchFolderValidation.MatchSearchFolderCriteria(searchFolderCriteria, searchCriteria))
            {
                FromPeopleFolderValidation.Tracer.TraceDebug((long)this.GetHashCode(), "Current criteria is not initialized or doesn't match desired criteria.  Updating.");
                searchFolder.ApplyContinuousSearch(searchCriteria);
            }
            FromPeopleFolderValidation.Tracer.TraceFunction((long)this.GetHashCode(), "Exiting FromPeopleFolderValidation.EnsureIsValid.  Validation is done.");
            return(true);
        }
Ejemplo n.º 2
0
        protected override void SetPropertiesInternal(DefaultFolderContext context, Folder folder)
        {
            FromPeopleFolderValidation.Tracer.TraceFunction((long)this.GetHashCode(), "FromPeopleFolderValidation.SetPropertiesInternal");
            base.SetPropertiesInternal(context, folder);
            folder.Save();
            SearchFolder searchFolder = (SearchFolder)folder;

            searchFolder.ApplyContinuousSearch(FromPeopleFolderValidation.GetSearchCriteria(context));
            folder.Load(null);
            FromPeopleFolderValidation.Tracer.TraceFunction((long)this.GetHashCode(), "Exiting FromPeopleFolderValidation.SetPropertiesInternal.  Initialization is done.");
        }