Exemple #1
0
        private ADRawEntry[] GetNextResultCollection()
        {
            this.vlvRequestControl.ContextId = base.Cookie;
            DirectoryControl            directoryControl;
            SearchResultEntryCollection nextResultCollection = base.GetNextResultCollection(typeof(VlvResponseControl), out directoryControl);

            ADProviderPerf.UpdateProcessCounter(Counter.ProcessRateVlv, UpdateType.Add, 1U);
            ADProviderPerf.UpdateDCCounter(base.PreferredServerName, Counter.DCRateVlv, UpdateType.Add, 1U);
            base.Cookie = null;
            if (directoryControl != null)
            {
                VlvResponseControl vlvResponseControl = (VlvResponseControl)directoryControl;
                base.Cookie            = vlvResponseControl.ContextId;
                this.estimatedRowCount = vlvResponseControl.ContentCount;
                this.currentRow        = vlvResponseControl.TargetPosition;
            }
            if (nextResultCollection == null)
            {
                return(null);
            }
            return(base.Session.ObjectsFromEntries <ADRawEntry>(nextResultCollection, base.PreferredServerName, this.properties, ADVirtualListView.dummyADRawEntry));
        }
Exemple #2
0
        protected override SearchResultEntryCollection GetNextResultCollection()
        {
            this.pageResultRequestControl.Cookie   = base.Cookie;
            this.pageResultRequestControl.PageSize = base.PageSize;
            if (base.PagesReturned > 0)
            {
                ADProviderPerf.UpdateProcessCounter(Counter.ProcessRatePaged, UpdateType.Add, 1U);
                ADProviderPerf.UpdateDCCounter(base.PreferredServerName, Counter.DCRatePaged, UpdateType.Add, 1U);
            }
            DirectoryControl            directoryControl;
            SearchResultEntryCollection nextResultCollection = base.GetNextResultCollection(typeof(PageResultResponseControl), out directoryControl);

            base.Cookie = ((directoryControl == null) ? null : ((PageResultResponseControl)directoryControl).Cookie);
            if (base.Cookie == null || base.Cookie.Length == 0 || nextResultCollection == null)
            {
                base.RetrievedAllData = new bool?(true);
            }
            else
            {
                base.RetrievedAllData = new bool?(false);
            }
            return(nextResultCollection);
        }
Exemple #3
0
        // Token: 0x060006F4 RID: 1780 RVA: 0x00025650 File Offset: 0x00023850
        protected override SearchResultEntryCollection GetNextResultCollection()
        {
            if (base.Session.NetworkCredential == null)
            {
                this.vlvRequestControl.ContextId = base.Cookie;
            }
            this.vlvRequestControl.Offset = this.offSet;
            if (this.searchForward)
            {
                this.vlvRequestControl.BeforeCount = 0;
                this.vlvRequestControl.AfterCount  = (this.includeBookmarkObject ? (base.PageSize - 1) : base.PageSize);
            }
            else
            {
                this.vlvRequestControl.BeforeCount = (this.includeBookmarkObject ? (base.PageSize - 1) : base.PageSize);
                this.vlvRequestControl.AfterCount  = 0;
            }
            DirectoryControl            directoryControl            = null;
            SearchResultEntryCollection searchResultEntryCollection = null;

            try
            {
                searchResultEntryCollection = base.GetNextResultCollection(typeof(VlvResponseControl), out directoryControl);
            }
            catch (ADInvalidHandleCookieException ex)
            {
                if (this.vlvRequestControl.ContextId == null || this.vlvRequestControl.ContextId.Length == 0)
                {
                    throw;
                }
                ExTraceGlobals.ADFindTracer.TraceDebug <string>((long)this.GetHashCode(), "ADVlvPagedReader::GetNextResultCollection encounter an exception \"{0}\". Clear the cookie and try again.", ex.Message);
                this.vlvRequestControl.ContextId = null;
                searchResultEntryCollection      = base.GetNextResultCollection(typeof(VlvResponseControl), out directoryControl);
            }
            ADProviderPerf.UpdateProcessCounter(Counter.ProcessRateVlv, UpdateType.Add, 1U);
            ADProviderPerf.UpdateDCCounter(base.PreferredServerName, Counter.DCRateVlv, UpdateType.Add, 1U);
            base.Cookie = ((directoryControl == null) ? null : ((VlvResponseControl)directoryControl).ContextId);
            if (!this.searchForward)
            {
                base.RetrievedAllData = new bool?(true);
            }
            if (directoryControl == null || searchResultEntryCollection.Count == 0)
            {
                base.RetrievedAllData = new bool?(true);
            }
            else
            {
                this.totalCount = ((VlvResponseControl)directoryControl).ContentCount;
                if (this.searchForward && base.PagesReturned == 0)
                {
                    this.offSet = ((VlvResponseControl)directoryControl).TargetPosition;
                    if (!this.includeBookmarkObject)
                    {
                        this.offSet++;
                    }
                }
                if (!this.searchForward)
                {
                    this.offSet = ((VlvResponseControl)directoryControl).TargetPosition - searchResultEntryCollection.Count + 1;
                }
                this.firstEntry = (string)searchResultEntryCollection[0].Attributes[ADRecipientSchema.DisplayName.LdapDisplayName].GetValues(typeof(string))[0];
                this.lastEntry  = (string)searchResultEntryCollection[searchResultEntryCollection.Count - 1].Attributes[ADRecipientSchema.DisplayName.LdapDisplayName].GetValues(typeof(string))[0];
                if (string.Compare(this.firstEntry, this.lastEntry, new CultureInfo(base.Lcid), CompareOptions.OrdinalIgnoreCase) == 0)
                {
                    base.RetrievedAllData = new bool?(true);
                }
                if (this.searchForward)
                {
                    this.vlvRequestControl.Target = Encoding.UTF8.GetBytes(this.lastEntry);
                }
                else
                {
                    this.vlvRequestControl.Target = Encoding.UTF8.GetBytes(this.firstEntry);
                }
            }
            return(searchResultEntryCollection);
        }