private SetSearchCriteriaFlags GetMappedFlag(SearchCriteriaFlags mapiFlag, SearchCriteriaFlags mapiValue, SetSearchCriteriaFlags storageValue)
 {
     if ((mapiFlag & mapiValue) != SearchCriteriaFlags.None)
     {
         return(storageValue);
     }
     return(SetSearchCriteriaFlags.None);
 }
        private SetSearchCriteriaFlags ConvertSearchCriteriaFlags(SearchCriteriaFlags mapiFlags)
        {
            SetSearchCriteriaFlags setSearchCriteriaFlags = SetSearchCriteriaFlags.None;

            setSearchCriteriaFlags |= this.GetMappedFlag(mapiFlags, SearchCriteriaFlags.Background, SetSearchCriteriaFlags.Background);
            setSearchCriteriaFlags |= this.GetMappedFlag(mapiFlags, SearchCriteriaFlags.ContentIndexed, SetSearchCriteriaFlags.ContentIndexed);
            setSearchCriteriaFlags |= this.GetMappedFlag(mapiFlags, SearchCriteriaFlags.ContentIndexedOnly, SetSearchCriteriaFlags.FailNonContentIndexedSearch);
            setSearchCriteriaFlags |= this.GetMappedFlag(mapiFlags, SearchCriteriaFlags.EstimateCountOnly, SetSearchCriteriaFlags.EstimateCountOnly);
            setSearchCriteriaFlags |= this.GetMappedFlag(mapiFlags, SearchCriteriaFlags.FailOnForeignEID, SetSearchCriteriaFlags.FailOnForeignEID);
            setSearchCriteriaFlags |= this.GetMappedFlag(mapiFlags, SearchCriteriaFlags.Foreground, SetSearchCriteriaFlags.Foreground);
            setSearchCriteriaFlags |= this.GetMappedFlag(mapiFlags, SearchCriteriaFlags.NonContentIndexed, SetSearchCriteriaFlags.NonContentIndexed);
            setSearchCriteriaFlags |= this.GetMappedFlag(mapiFlags, SearchCriteriaFlags.Recursive, SetSearchCriteriaFlags.Recursive);
            setSearchCriteriaFlags |= this.GetMappedFlag(mapiFlags, SearchCriteriaFlags.Restart, SetSearchCriteriaFlags.Restart);
            setSearchCriteriaFlags |= this.GetMappedFlag(mapiFlags, SearchCriteriaFlags.Shallow, SetSearchCriteriaFlags.Shallow);
            setSearchCriteriaFlags |= this.GetMappedFlag(mapiFlags, SearchCriteriaFlags.Static, SetSearchCriteriaFlags.Static);
            setSearchCriteriaFlags |= this.GetMappedFlag(mapiFlags, SearchCriteriaFlags.StatisticsOnly, SetSearchCriteriaFlags.StatisticsOnly);
            setSearchCriteriaFlags |= this.GetMappedFlag(mapiFlags, SearchCriteriaFlags.Stop, SetSearchCriteriaFlags.Stop);
            return(setSearchCriteriaFlags | this.GetMappedFlag(mapiFlags, SearchCriteriaFlags.UseCiForComplexQueries, SetSearchCriteriaFlags.UseCiForComplexQueries));
        }
        bool IDestinationFolder.SetSearchCriteria(RestrictionData restriction, byte[][] entryIds, SearchCriteriaFlags flags)
        {
            Restriction native = DataConverter <RestrictionConverter, Restriction, RestrictionData> .GetNative(restriction);

            using (base.Mailbox.RHTracker.Start())
            {
                base.Folder.SetSearchCriteria(native, entryIds, flags);
            }
            return(true);
        }
 bool IDestinationFolder.SetSearchCriteria(RestrictionData restriction, byte[][] entryIds, SearchCriteriaFlags flags)
 {
     return(base.MrsProxy.IDestinationFolder_SetSearchCriteria(base.Handle, restriction, entryIds, (int)flags));
 }
Ejemplo n.º 5
0
 bool IDestinationFolder.SetSearchCriteria(RestrictionData restriction, byte[][] entryIds, SearchCriteriaFlags flags)
 {
     return(true);
 }
Ejemplo n.º 6
0
 bool IDestinationFolder.SetSearchCriteria(RestrictionData restriction, byte[][] entryIds, SearchCriteriaFlags flags)
 {
     throw new NotImplementedException();
 }
Ejemplo n.º 7
0
        bool IDestinationFolder.SetSearchCriteria(RestrictionData restriction, byte[][] entryIds, SearchCriteriaFlags flags)
        {
            bool result = false;

            base.CreateContext("IDestinationFolder.SetSearchCriteria", new DataContext[]
            {
                new RestrictionDataContext(restriction),
                new EntryIDsDataContext(entryIds),
                new SimpleValueDataContext("Flags", flags)
            }).Execute(delegate
            {
                result = ((IDestinationFolder)this.WrappedObject).SetSearchCriteria(restriction, entryIds, flags);
            }, true);
            return(result);
        }
        bool IDestinationFolder.SetSearchCriteria(RestrictionData restriction, byte[][] entryIds, SearchCriteriaFlags flags)
        {
            MrsTracer.Provider.Function("StorageDestinationFolder.SetSearchCriteria: {0}", new object[]
            {
                base.DisplayNameForTracing
            });
            QueryFilter queryFilter = restriction.GetQueryFilter(base.Mailbox.StoreSession);

            StoreId[] array = null;
            if (entryIds != null && entryIds.Length > 0)
            {
                array = new StoreId[entryIds.Length];
                for (int i = 0; i < entryIds.Length; i++)
                {
                    array[i] = StoreObjectId.FromProviderSpecificId(entryIds[i]);
                }
            }
            using (base.Mailbox.RHTracker.Start())
            {
                SearchFolderCriteria searchFolderCriteria = new SearchFolderCriteria(queryFilter, array);
                base.CoreFolder.SetSearchCriteria(searchFolderCriteria, this.ConvertSearchCriteriaFlags(flags));
            }
            return(true);
        }