Пример #1
0
        public bool SetBookList(string html, int pageIndex)
        {
            if (!string.IsNullOrEmpty(html))
            {
                var arrary = AnalysisSoduService.GetRankListFromHtml(html);
                if (arrary == null)
                {
                    return(false);
                }
                else
                {
                    if (this.BookList != null)
                    {
                        this.BookList.Clear();
                    }
                    this.PageIndex = pageIndex;
                    foreach (var item in arrary)
                    {
                        this.BookList.Add(item);
                    }
                    return(true);
                }
            }

            return(false);
        }
Пример #2
0
        public bool SetBookList(string html, int pageIndex)
        {
            if (!string.IsNullOrEmpty(html))
            {
                ObservableCollection <BookEntity> arrary = AnalysisSoduService.GetRankListFromHtml(html);
                if (arrary == null)
                {
                    return(false);
                }
                else
                {
                    this.BookList?.Clear();

                    foreach (var item in arrary)
                    {
                        BookList.Add(item);
                    }
                    this.PageIndex = pageIndex;
                    return(true);
                }
            }
            return(false);
        }
Пример #3
0
        public bool SetBookList(string html)
        {
            bool result = false;

            this.SearchResultList.Clear();
            try
            {
                if (!string.IsNullOrEmpty(html))
                {
                    ObservableCollection <BookEntity> arraryList = AnalysisSoduService.GetRankListFromHtml(html);
                    if (arraryList == null)
                    {
                        return(false);
                    }
                    else
                    {
                        if (arraryList.Count > 0)
                        {
                            foreach (var item in arraryList)
                            {
                                this.SearchResultList.Add(item);
                            }
                        }
                        result = true;
                    }
                }
                else
                {
                    return(result);
                }
            }
            catch (Exception)
            {
                result = false;
            }
            return(result);
        }