Esempio n. 1
0
 public LdapPagedResultsControl(int size, [CanBeNull] byte[] cookie) : base(RequestOid, true, null)
 {
     Size   = size;
     Cookie = cookie ?? GetEmptyCookie;
     BuildTypedPagedRequest();
     // ReSharper disable once VirtualMemberCallInConstructor
     SetValue(_request.GetEncoding(new LberEncoder()));
 }
        /// <summary>
        ///     Constructs a virtual list control using the specified filter
        ///     expression along with an optional server context.
        ///     The expression specifies the first entry to be used for the
        ///     virtual search results. The other two paramers are the number of
        ///     entries before and after a located index to be returned.
        /// </summary>
        /// <param name="jumpTo">
        ///     A search expression that defines the first
        ///     element to be returned in the virtual search results. The filter
        ///     expression in the search operation itself may be, for example,
        ///     "objectclass=person" and the jumpTo expression in the virtual
        ///     list control may be "cn=m*", to retrieve a subset of entries
        ///     starting at or centered around those with a common name beginning
        ///     with the letter "M".
        /// </param>
        /// <param name="beforeCount">
        ///     The number of entries before startIndex (the
        ///     reference entry) to be returned.
        /// </param>
        /// <param name="afterCount">
        ///     The number of entries after startIndex to be
        ///     returned.
        /// </param>
        /// <param name="context">
        ///     Used by some implementations to process requests
        ///     more efficiently. The context should be null on the first search,
        ///     and thereafter it should be whatever was returned by the server in the
        ///     virtual list response control.
        /// </param>
        public LdapVirtualListControl(string jumpTo, int beforeCount, int afterCount, string context)
            : base(RequestOid, true, null)
        {
            /* Save off the fields in local variables
             */
            _mBeforeCount = beforeCount;
            _mAfterCount  = afterCount;
            _mJumpTo      = jumpTo;
            _mContext     = context;

            /* Call private method to build the ASN.1 encoded request packet.
             */
            BuildTypedVlvRequest();

            /* Set the request data field in the in the parent LdapControl to
             * the ASN.1 encoded value of this control.  This encoding will be
             * appended to the search request when the control is sent.
             */
            SetValue(_mVlvRequest.GetEncoding(new LberEncoder()));
        }
        // Put together search control value and have the base class - LdapControl package the request.
        public LdapPagedResultsControl(int pageSize, String cookie) : base(requestOID, true, null)
        {
            m_pageSize = pageSize;
            m_cookie   = cookie;

            BuildPagedSearchRequest();

            /* Set the request data field in the in the parent LdapControl to
             * the ASN.1 encoded value of this control.  This encoding will be
             * appended to the search request when the control is sent.
             */

            SetValue(m_pagedSearchRequest.GetEncoding(new LberEncoder()));
            return;
        }