Beispiel #1
0
        private async void MoreItemsRequest()
        {
            try
            {
                IsBusy              = true;
                HasErrors           = false;
                NoItems             = false;
                DataProviderRawData = string.Empty;
                Items.Clear();

                var items = await localStorageDataProvider.LoadMoreDataAsync();

                NoItems = !items.Any();

                foreach (var item in items)
                {
                    Items.Add(item);
                }

                var rawParser = new RawParser();
                var rawData   = await rawDataProvider.LoadMoreDataAsync();

                DataProviderRawData = rawData.FirstOrDefault()?.Raw;
            }
            catch (Exception ex)
            {
                DataProviderRawData += ex.Message;
                DataProviderRawData += ex.StackTrace;
                HasErrors            = true;
            }
            finally
            {
                IsBusy = false;
            }
        }
Beispiel #2
0
        private async void Request()
        {
            try
            {
                IsBusy              = true;
                HasErrors           = false;
                NoItems             = false;
                DataProviderRawData = string.Empty;
                Items.Clear();

                var twitterDataProvider = new TwitterDataProvider(new TwitterOAuthTokens
                {
                    AccessToken       = AccessToken,
                    AccessTokenSecret = AccessTokenSecret,
                    ConsumerKey       = ConsumerKey,
                    ConsumerSecret    = ConsumerSecret
                });

                var config = new TwitterDataConfig
                {
                    Query     = TwitterQueryParam,
                    QueryType = TwitterQueryTypeSelectedItem
                };

                var rawParser = new RawParser();
                var rawData   = await twitterDataProvider.LoadDataAsync(config, MaxRecordsParam, rawParser);

                DataProviderRawData = rawData.FirstOrDefault()?.Raw;

                var items = await twitterDataProvider.LoadDataAsync(config, MaxRecordsParam);

                NoItems = !items.Any();

                foreach (var item in items)
                {
                    Items.Add(item);
                }
            }
            catch (Exception ex)
            {
                DataProviderRawData += ex.Message;
                DataProviderRawData += ex.StackTrace;
                HasErrors            = true;
            }
            finally
            {
                IsBusy = false;
            }
        }
Beispiel #3
0
        private async void Request()
        {
            try
            {
                IsBusy              = true;
                HasErrors           = false;
                NoItems             = false;
                DataProviderRawData = string.Empty;
                Items.Clear();

                var config = new RestApiDataConfig()
                {
                    Url = new Uri(RestApiQuery),
                };

                var paginationConfig = GetPaginationConfig();
                if (paginationConfig != null)
                {
                    config.PaginationConfig = paginationConfig;
                }

                var parser = new RestApiSampleParser();
                parser.InitializeSample(RestApiMainRoot, TextProperty1, TextProperty2, ImageProperty);
                var items = await restApiDataProvider.LoadDataAsync(config, MaxRecordsParam, parser);

                NoItems = !items.Any();

                foreach (var item in items)
                {
                    Items.Add(item);
                }

                var rawParser = new RawParser();
                var rawData   = await rawDataProvider.LoadDataAsync(config, MaxRecordsParam, rawParser);

                DataProviderRawData = rawData.FirstOrDefault()?.Raw;
            }
            catch (Exception ex)
            {
                DataProviderRawData += ex.Message;
                DataProviderRawData += ex.StackTrace;
                HasErrors            = true;
            }
            finally
            {
                IsBusy = false;
            }
        }
Beispiel #4
0
        private async void Request()
        {
            try
            {
                IsBusy              = true;
                HasErrors           = false;
                NoItems             = false;
                DataProviderRawData = string.Empty;
                Items.Clear();

                var youTubeDataProvider = new YouTubeDataProvider(new YouTubeOAuthTokens {
                    ApiKey = ApiKey
                });
                var config = new YouTubeDataConfig
                {
                    Query     = YouTubeQueryParam,
                    QueryType = YouTubeQueryTypeSelectedItem
                };

                var rawParser = new RawParser();
                var rawData   = await youTubeDataProvider.LoadDataAsync(config, MaxRecordsParam, rawParser);

                DataProviderRawData = rawData.FirstOrDefault()?.Raw;

                var items = await youTubeDataProvider.LoadDataAsync(config, MaxRecordsParam);

                NoItems = !items.Any();

                foreach (var item in items)
                {
                    Items.Add(item);
                }
            }
            catch (Exception ex)
            {
                DataProviderRawData += ex.Message;
                DataProviderRawData += ex.StackTrace;
                HasErrors            = true;
            }
            finally
            {
                IsBusy = false;
            }
        }
Beispiel #5
0
        private async void Request()
        {
            try
            {
                IsBusy              = true;
                HasErrors           = false;
                NoItems             = false;
                DataProviderRawData = string.Empty;
                Items.Clear();

                var facebookDataProvider = new FacebookDataProvider(new FacebookOAuthTokens {
                    AppId = AppId, AppSecret = AppSecret
                });
                var config = new FacebookDataConfig
                {
                    UserId = FacebookQueryParam
                };

                var rawParser = new RawParser();
                var rawData   = await facebookDataProvider.LoadDataAsync(config, MaxRecordsParam, rawParser);

                DataProviderRawData = rawData.FirstOrDefault()?.Raw;

                var items = await facebookDataProvider.LoadDataAsync(config, MaxRecordsParam);

                NoItems = !items.Any();

                foreach (var item in items)
                {
                    Items.Add(item);
                }
            }
            catch (Exception ex)
            {
                DataProviderRawData += ex.Message;
                DataProviderRawData += ex.StackTrace;
                HasErrors            = true;
            }
            finally
            {
                IsBusy = false;
            }
        }
Beispiel #6
0
        private async void Request()
        {
            try
            {
                IsBusy              = true;
                HasErrors           = false;
                NoItems             = false;
                DataProviderRawData = string.Empty;
                Items.Clear();

                var config = new FlickrDataConfig
                {
                    Query          = FlickrQueryParam,
                    QueryType      = FlickrQueryTypeSelectedItem,
                    OrderBy        = OrderBy != FlickrSampleOrderBy.None? OrderBy.ToString():string.Empty,
                    OrderDirection = SortDirection
                };

                var items = await flickrDataProvider.LoadDataAsync(config, MaxRecordsParam);

                NoItems = !items.Any();

                foreach (var item in items)
                {
                    Items.Add(item);
                }

                var rawParser = new RawParser();
                var rawData   = await rawDataProvider.LoadDataAsync(config, MaxRecordsParam, rawParser);

                DataProviderRawData = rawData.FirstOrDefault()?.Raw;
            }
            catch (Exception ex)
            {
                DataProviderRawData += ex.Message;
                DataProviderRawData += ex.StackTrace;
                HasErrors            = true;
            }
            finally
            {
                IsBusy = false;
            }
        }
Beispiel #7
0
        private async void Request()
        {
            try
            {
                IsBusy              = true;
                HasErrors           = false;
                NoItems             = false;
                DataProviderRawData = string.Empty;
                Items.Clear();

                var config = new LocalStorageDataConfig
                {
                    FilePath       = LocalStorageQuery,
                    OrderBy        = OrderBy.ToString(),
                    OrderDirection = SortDirection
                };

                var items = await localStorageDataProvider.LoadDataAsync(config, MaxRecordsParam);

                NoItems = !items.Any();

                foreach (var item in items)
                {
                    Items.Add(item);
                }

                var rawParser = new RawParser();
                var rawData   = await rawDataProvider.LoadDataAsync(config, MaxRecordsParam, rawParser);

                DataProviderRawData = rawData.FirstOrDefault()?.Raw;
            }
            catch (Exception ex)
            {
                DataProviderRawData += ex.Message;
                DataProviderRawData += ex.StackTrace;
                HasErrors            = true;
            }
            finally
            {
                IsBusy = false;
            }
        }
Beispiel #8
0
        private async void Request()
        {
            try
            {
                IsBusy              = true;
                HasErrors           = false;
                NoItems             = false;
                DataProviderRawData = string.Empty;
                Items.Clear();
                var wordPressDataProvider = new WordPressDataProvider();
                var config = new WordPressDataConfig()
                {
                    Query     = WordPressQuery,
                    QueryType = WordPressQueryTypeSelectedItem,
                    FilterBy  = WordPressQueryFilterBy
                };

                var rawParser = new RawParser();
                var rawData   = await wordPressDataProvider.LoadDataAsync(config, MaxRecordsParam, rawParser);

                DataProviderRawData = rawData.FirstOrDefault()?.Raw;

                var items = await wordPressDataProvider.LoadDataAsync(config, MaxRecordsParam);

                NoItems = !items.Any();

                foreach (var item in items)
                {
                    Items.Add(item);
                }
            }
            catch (Exception ex)
            {
                DataProviderRawData += ex.Message;
                DataProviderRawData += ex.StackTrace;
                HasErrors            = true;
            }
            finally
            {
                IsBusy = false;
            }
        }
Beispiel #9
0
        private async void Request()
        {
            try
            {
                IsBusy              = true;
                HasErrors           = false;
                NoItems             = false;
                DataProviderRawData = string.Empty;
                Items.Clear();
                var rssDataProvider = new RssDataProvider();
                var config          = new RssDataConfig {
                    Url = new Uri(RssQuery, UriKind.Absolute)
                };

                var rawParser = new RawParser();
                var rawData   = await rssDataProvider.LoadDataAsync(config, MaxRecordsParam, rawParser);

                DataProviderRawData = rawData.FirstOrDefault()?.Raw;

                var items = await rssDataProvider.LoadDataAsync(config, MaxRecordsParam);

                NoItems = !items.Any();

                foreach (var item in items)
                {
                    Items.Add(item);
                }
            }
            catch (Exception ex)
            {
                DataProviderRawData += ex.Message;
                DataProviderRawData += ex.StackTrace;
                HasErrors            = true;
            }
            finally
            {
                IsBusy = false;
            }
        }