Exemplo n.º 1
0
        public static void ExecuteGaleryScrape(MainPage mainpage, SynchronizationContext context, Api.Parameter.OverviewParameter parameters = null)
        {
            if (parameters == null)
            {
                parameters = new Api.Parameter.OverviewParameter();
            }

            context.Post((_) =>
            {
                mainpage.SkoftenDataContext.GalleryItemsLoading = true;
            }, null);

            parameters.Type = mainpage.SkoftenDataContext.CurrentGalleryType;

            if (parameters.StartOver)
            {
                mainpage.SkoftenDataContext.GalleryPaging    = 0;
                mainpage.SkoftenDataContext.GalleryItemIndex = 0;
                mainpage.SkoftenDataContext.SelectedGallery  = 0;
            }


            parameters.Paging = mainpage.SkoftenDataContext.GalleryPaging;

            mainpage.SkoftenDataContext.GalleryPaging += 12;

            OverviewExecute oe = new OverviewExecute();

            oe.Parameters = parameters;
            oe.Execute();
            var result = oe.Result;


            context.Post((_) =>
            {
                if (parameters.StartOver)
                {
                    mainpage.SkoftenDataContext.Gallery.Clear();
                }

                foreach (var item in result)
                {
                    if (parameters.Type == Api.Parameter.OverviewType.EroDump)
                    {
                        if (!item.Url.Contains("babes.skoften.net"))
                        {
                            mainpage.SkoftenDataContext.GalleryItemIndex++;
                            continue;
                        }
                    }

                    item.Index = mainpage.SkoftenDataContext.GalleryItemIndex;
                    mainpage.SkoftenDataContext.Gallery.Add(item);
                    mainpage.SkoftenDataContext.GalleryItemIndex++;
                }

                mainpage.SkoftenDataContext.GalleryItemsLoading = false;
            }, null);
        }
Exemplo n.º 2
0
        public static void ExecuteGaleryScrape(MainPage mainpage, SynchronizationContext context, ApiUniversal.Parameter.OverviewParameter parameters = null)
        {
            if (parameters == null)
            {
                parameters = new ApiUniversal.Parameter.OverviewParameter();
            }

            context.Post((_) =>
            {
                mainpage.PageDataContext.GalleryItemsLoading = true;

                if (parameters.StartOver)
                {
                    mainpage.PageDataContext.Gallery.Clear();
                }
            }, null);

            parameters.Category = mainpage.PageDataContext.CurrentArticleGallery;

            if (parameters.StartOver)
            {
                mainpage.PageDataContext.GalleryPaging    = 0;
                mainpage.PageDataContext.GalleryItemIndex = 0;
                mainpage.PageDataContext.SelectedGallery  = 0;
            }

            mainpage.PageDataContext.GalleryPaging += 1;
            parameters.Paging = mainpage.PageDataContext.GalleryPaging;

            OverviewExecute oe = new OverviewExecute();

            oe.Parameters = parameters;
            oe.Execute();
            var result = oe.Result;


            context.Post((_) =>
            {
                if (parameters.StartOver)
                {
                    mainpage.PageDataContext.Gallery.Clear();
                }

                foreach (var item in result)
                {
                    item.Index = mainpage.PageDataContext.GalleryItemIndex;
                    mainpage.PageDataContext.Gallery.Add(item);
                    mainpage.PageDataContext.GalleryItemIndex++;
                }

                mainpage.PageDataContext.GalleryItemsLoading = false;
            }, null);
        }
        private void ShowMyLists()
        {
            var storage = new Storage();
            var param   = new Api.Parameter.OverviewParameter();

            param.LoginName     = storage.LoadFromLocal(StorageKeys.LoggedInName)?.ToString() ?? string.Empty;
            param.LoginPassword = storage.LoadFromLocal(StorageKeys.LoggedInPassword)?.ToString() ?? string.Empty;

            OverviewExecute overview = new OverviewExecute()
            {
                Parameters = param
            };

            overview.Execute();

            var result = overview.Result;

            PageDataContext.SetResult(result);
        }