예제 #1
0
        public async Task <IEnumerable <FlickrSchema> > LoadData()
        {
            if (_data == null)
            {
                try
                {
                    var rssDataProvider  = new RssDataProvider(_url);
                    var syndicationItems = await rssDataProvider.Load();

                    _data = (from r in syndicationItems
                             select new FlickrSchema()
                    {
                        Title = r.Title,
                        Summary = r.Summary,
                        ImageUrl = r.ImageUrl,
                        Published = r.PublishDate
                    }).ToArray();

                    // Change medium images to large
                    foreach (var item in _data)
                    {
                        item.ImageUrl = item.ImageUrl.Replace("_m.jpg", "_b.jpg");
                    }
                }
                catch (Exception ex)
                {
                    AppLogs.WriteError("GoProPhotosDataSourceDataSource.LoadData", ex.ToString());
                }
            }
            return(_data);
        }
예제 #2
0
        public async Task <IEnumerable <BingSchema> > LoadData()
        {
            if (_data == null)
            {
                try
                {
                    var rssDataProvider  = new RssDataProvider(_url);
                    var syndicationItems = await rssDataProvider.Load();

                    _data = from r in syndicationItems
                            select new BingSchema()
                    {
                        Title     = r.Title,
                        Summary   = r.Summary,
                        Link      = r.FeedUrl,
                        Published = r.PublishDate
                    };
                }
                catch (Exception ex)
                {
                    AppLogs.WriteError("ArmiaWBinguDataSourceDataSource.LoadData", ex.ToString());
                }
            }
            return(_data);
        }
예제 #3
0
 public async override Task <IEnumerable <RssSchema> > LoadDataAsync()
 {
     try
     {
         var rssDataProvider = new RssDataProvider(_url);
         return(await rssDataProvider.Load());
     }
     catch (Exception ex)
     {
         AppLogs.WriteError("ElwatanDataSourceDataSource.LoadData", ex.ToString());
         return(new RssSchema[0]);
     }
 }
예제 #4
0
 public async Task <IEnumerable <RssSchema> > LoadData()
 {
     if (_data == null)
     {
         try
         {
             var rssDataProvider = new RssDataProvider(_url);
             _data = await rssDataProvider.Load();
         }
         catch (Exception ex)
         {
             AppLogs.WriteError("TheOatmealDataSourceDataSource.LoadData", ex.ToString());
         }
     }
     return(_data);
 }
예제 #5
0
        public async Task<ObservableCollection<FacebookSchema>> Load()
        {
            var reader = new RssDataProvider(_uri.ToString());
            var rssSchemaList = await reader.Load();
            var result = new ObservableCollection<FacebookSchema>
                (
                    rssSchemaList.Select(rss => new FacebookSchema()
                    {
                        Author = rss.Author,
                        Content = rss.Content,
                        FeedUrl = rss.FeedUrl,
                        Id = rss.Id,
                        ImageUrl = rss.ImageUrl,
                        PublishDate = rss.PublishDate,
                        Summary = rss.Summary,
                        Title = rss.Title
                    })
                    .OrderByDescending(f => f.PublishDate)
                );

            return result;
        }
        public async Task<ObservableCollection<FacebookSchema>> Load()
        {
            var rssProvider = new RssDataProvider(_uri.ToString(), "Mozilla/5.0 (Windows NT 6.3; Trident/7.0; rv:11.0) like Gecko");

            var rssSchemaList = await rssProvider.Load();
            var result = new ObservableCollection<FacebookSchema>
                (
                    rssSchemaList.Select(rss => new FacebookSchema()
                    {
                        Author = rss.Author,
                        Content = rss.Content,
                        FeedUrl = rss.FeedUrl,
                        Id = rss.Id,
                        ImageUrl = this.ConvertImageUrlFromParameter(rss.ImageUrl),
                        PublishDate = rss.PublishDate,
                        Summary = rss.Summary,
                        Title = rss.Title
                    })
                    .OrderByDescending(f => f.PublishDate)
                );

            return result;
        }
예제 #7
0
        public async Task <ObservableCollection <FacebookSchema> > Load()
        {
            var reader        = new RssDataProvider(_uri.ToString());
            var rssSchemaList = await reader.Load();

            var result = new ObservableCollection <FacebookSchema>
                         (
                rssSchemaList.Select(rss => new FacebookSchema()
            {
                Author      = rss.Author,
                Content     = rss.Content,
                FeedUrl     = rss.FeedUrl,
                Id          = rss.Id,
                ImageUrl    = rss.ImageUrl,
                PublishDate = rss.PublishDate,
                Summary     = rss.Summary,
                Title       = rss.Title
            })
                .OrderByDescending(f => f.PublishDate)
                         );

            return(result);
        }
        public async Task <ObservableCollection <FacebookSchema> > Load()
        {
            var rssProvider = new RssDataProvider(_uri.ToString(), "Mozilla/5.0 (Windows NT 6.3; Trident/7.0; rv:11.0) like Gecko");

            var rssSchemaList = await rssProvider.Load();

            var result = new ObservableCollection <FacebookSchema>
                         (
                rssSchemaList.Select(rss => new FacebookSchema()
            {
                Author      = rss.Author,
                Content     = rss.Content,
                FeedUrl     = rss.FeedUrl,
                Id          = rss.Id,
                ImageUrl    = this.ConvertImageUrlFromParameter(rss.ImageUrl),
                PublishDate = rss.PublishDate,
                Summary     = rss.Summary,
                Title       = rss.Title
            })
                .OrderByDescending(f => f.PublishDate)
                         );

            return(result);
        }
예제 #9
0
        public async override Task <IEnumerable <FlickrSchema> > LoadDataAsync()
        {
            try
            {
                var rssDataProvider  = new RssDataProvider(_url);
                var syndicationItems = await rssDataProvider.Load();

                return((from r in syndicationItems
                        select new FlickrSchema()
                {
                    Title = r.Title,
                    Summary = r.Summary,
                    // Change medium images to large
                    ImageUrl = r.ImageUrl.Replace("_m.jpg", "_b.jpg"),
                    Published = r.PublishDate,
                    FeedUrl = r.FeedUrl
                }).ToArray());
            }
            catch (Exception ex)
            {
                AppLogs.WriteError("FlickrDataSourceDataSource.LoadData", ex.ToString());
                return(new FlickrSchema[0]);
            }
        }