Beispiel #1
0
 public ComicDetails(string comicUrl)
 {
     InitializeComponent();
     this._comicUrl       = comicUrl;
     _parser              = new ReadComicBooksOnlineLatestItems_Parser();
     comicDetailStructure = new ComicDetailStructure();
     comicImagesStructure = new ComicImagesStructure();
 }
Beispiel #2
0
        public async static Task <ObservableCollection <ComicListStructure> > GetLatestComicUpdates()
        {
            var http = new HttpClient();
            //http.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("bearer", App.bearerToken);
            var response = await http.GetAsync(ServiceUrl.base_comic_url);

            var webResult = await response.Content.ReadAsStringAsync();

            ReadComicBooksOnlineLatestItems_Parser    parser             = new ReadComicBooksOnlineLatestItems_Parser();
            ObservableCollection <ComicListStructure> comicListStructure = await parser.ExtractLatestComics(webResult);

            return(comicListStructure);
        }
Beispiel #3
0
        public async static Task <ObservableCollection <ComicListStructure> > GetComicSearches(string searchText)
        {
            var http = new HttpClient();
            //http.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("bearer", App.bearerToken);
            ObservableCollection <ComicListStructure> comicListStructure = new ObservableCollection <ComicListStructure>()
            {
            };
            var response = await http.GetAsync(ServiceUrl.base_comic_search_url + searchText);

            var webResult = await response.Content.ReadAsStringAsync();

            // When Nothing is Found, we return an empty list.
            if (webResult.Contains("Your search yielded no results"))
            {
                return(comicListStructure);
            }
            ReadComicBooksOnlineLatestItems_Parser parser = new ReadComicBooksOnlineLatestItems_Parser();

            comicListStructure = await parser.ExtractComicSearch(searchText, webResult);

            return(comicListStructure);
        }