/// <summary>
        /// Search patents.
        /// </summary>
        /// <param name="keyword">The keyword.</param>
        /// <param name="resultCount">The count of result itmes.</param>
        /// <param name="issuedOnly">Whether restrict the search to ONLY patents that having been issued, skiping all patents that have only been filed.</param>
        /// <param name="filedOnly">Whether restrict the search to ONLY patents that only been filed, skipping over all patents that have been issued.</param>
        /// <param name="sortBy">The way to order results.</param>
        /// <returns>The result items.</returns>
        /// <remarks>
        /// When both issuedOnly and filedOnly are true, it equals to both are false.
        /// Now, the max count of items Google given is <b>64</b>.
        /// </remarks>
        public IList <IPatentResult> Search(
            string keyword,
            int resultCount,
            bool issuedOnly,
            bool filedOnly,
            string sortBy)
        {
            if (keyword == null)
            {
                throw new ArgumentNullException("keyword");
            }

            var request = new GpatentSearchRequest
            {
                Query = keyword, IssuedOnly = issuedOnly, FiledOnly = filedOnly, SortBy = sortBy
            };

            return(this.Search <GpatentResult, IPatentResult>(request, resultCount));
        }
        /// <summary>
        /// Begins an asynchronous request for searching patents.
        /// </summary>
        /// <param name="keyword">The keyword.</param>
        /// <param name="resultCount">The count of result itmes.</param>
        /// <param name="issuedOnly">Whether restrict the search to ONLY patents that having been issued, skiping all patents that have only been filed.</param>
        /// <param name="filedOnly">Whether restrict the search to ONLY patents that only been filed, skipping over all patents that have been issued.</param>
        /// <param name="sortBy">The way to order results.</param>
        /// <param name="callback">The <see cref="AsyncCallback"/> delegate.</param>
        /// <param name="state">An object containing state information for this asynchronous request.</param>
        /// <returns>An <see cref="IAsyncResult"/> that references the asynchronous request.</returns>
        /// <remarks>
        /// When both issuedOnly and filedOnly are true, it equals to both are false.
        /// </remarks>
        public IAsyncResult BeginSearch(
            string keyword,
            int resultCount,
            bool issuedOnly,
            bool filedOnly,
            string sortBy,
            AsyncCallback callback,
            object state)
        {
            if (keyword == null)
            {
                throw new ArgumentNullException("keyword");
            }

            var request = new GpatentSearchRequest
            {
                Query      = keyword,
                IssuedOnly = issuedOnly,
                FiledOnly  = filedOnly,
                SortBy     = sortBy
            };

            return(this.BeginSearch <GpatentResult>(request, resultCount, callback, state));
        }
        /// <summary>
        /// Begins an asynchronous request for searching patents.
        /// </summary>
        /// <param name="keyword">The keyword.</param>
        /// <param name="resultCount">The count of result itmes.</param>
        /// <param name="issuedOnly">Whether restrict the search to ONLY patents that having been issued, skiping all patents that have only been filed.</param>
        /// <param name="filedOnly">Whether restrict the search to ONLY patents that only been filed, skipping over all patents that have been issued.</param>
        /// <param name="sortBy">The way to order results.</param>
        /// <param name="callback">The <see cref="AsyncCallback"/> delegate.</param>
        /// <param name="state">An object containing state information for this asynchronous request.</param>
        /// <returns>An <see cref="IAsyncResult"/> that references the asynchronous request.</returns>
        /// <remarks>
        /// When both issuedOnly and filedOnly are true, it equals to both are false.
        /// </remarks>
        public IAsyncResult BeginSearch(
            string keyword,
            int resultCount,
            bool issuedOnly,
            bool filedOnly,
            string sortBy,
            AsyncCallback callback,
            object state)
        {
            if (keyword == null)
            {
                throw new ArgumentNullException("keyword");
            }

            var request = new GpatentSearchRequest
            {
                Query = keyword,
                IssuedOnly = issuedOnly,
                FiledOnly = filedOnly,
                SortBy = sortBy
            };
            return this.BeginSearch<GpatentResult>(request, resultCount, callback, state);
        }
        /// <summary>
        /// Search patents.
        /// </summary>
        /// <param name="keyword">The keyword.</param>
        /// <param name="resultCount">The count of result itmes.</param>
        /// <param name="issuedOnly">Whether restrict the search to ONLY patents that having been issued, skiping all patents that have only been filed.</param>
        /// <param name="filedOnly">Whether restrict the search to ONLY patents that only been filed, skipping over all patents that have been issued.</param>
        /// <param name="sortBy">The way to order results.</param>
        /// <returns>The result items.</returns>
        /// <remarks>
        /// When both issuedOnly and filedOnly are true, it equals to both are false.
        /// Now, the max count of items Google given is <b>64</b>.
        /// </remarks>
        public IList<IPatentResult> Search(
            string keyword,
            int resultCount,
            bool issuedOnly,
            bool filedOnly,
            string sortBy)
        {
            if (keyword == null)
            {
                throw new ArgumentNullException("keyword");
            }

            var request = new GpatentSearchRequest
                {
                    Query = keyword, IssuedOnly = issuedOnly, FiledOnly = filedOnly, SortBy = sortBy 
                };
            return this.Search<GpatentResult, IPatentResult>(request, resultCount);
        }