Example #1
0
 public Type GetUnderlyingSearcherType()
 {
     this.CheckDisposed();
     if (this.qbeFilter != null)
     {
         StoreCtx queryCtx = this.ctx.QueryCtx;
         if (queryCtx.SupportsSearchNatively)
         {
             return(queryCtx.SearcherNativeType());
         }
         else
         {
             throw new InvalidOperationException(StringResources.PrincipalSearcherNoUnderlying);
         }
     }
     else
     {
         throw new InvalidOperationException(StringResources.PrincipalSearcherMustSetFilter);
     }
 }
        public Type GetUnderlyingSearcherType()
        {
            GlobalDebug.WriteLineIf(GlobalDebug.Info, "PrincipalSearcher", "Entering GetUnderlyingSearcherType");

            CheckDisposed();

            // We have to have a filter
            if (_qbeFilter == null)
            {
                throw new InvalidOperationException(StringResources.PrincipalSearcherMustSetFilter);
            }

            StoreCtx storeCtx = _ctx.QueryCtx;

            Debug.Assert(storeCtx != null);

            // The underlying context must actually support search (i.e., no MSAM/reg-SAM)
            if (storeCtx.SupportsSearchNatively == false)
            {
                throw new InvalidOperationException(StringResources.PrincipalSearcherNoUnderlying);
            }

            return(storeCtx.SearcherNativeType());
        }