public FeedListPanoramaItemViewModel(NewsSite newsSite, IFeedDataService feedDataService)
            : base()
        {
            NewsSite = newsSite;
            FeedDataService = feedDataService;

            if (null != newsSite.ImageUrl)
            {
                HeaderImageUrl = newsSite.ImageUrl;
            }
            else
            {
                HeaderText = newsSite.Name;
            }

            Items = new ObservableCollection<FeedItem>();

            RefreshCommand = new RelayCommand(() => FeedDataService.GetFeedItems(NewsSite.FeedUrl,
                (feedItems, exception) =>
                    {
                        if (null != exception)
                        {
                            Debug.WriteLine(exception.ToString());
                        }
                        else
                        {
                            Items = new ObservableCollection<FeedItem>();
                            foreach (var feedItem in feedItems)
                            {
                                Items.Add(feedItem);
                            }
                        }
                    }
            ));
        }
        public FeedItemDetailViewModel(IFeedDataService feedDataService)
        {
            FeedDataService = feedDataService;

            EmailCommand = new RelayCommand(() =>
            {
                var emailcomposer = new EmailComposeTask
                {
                    Subject = "Check out this article",
                    Body = "Hey, you should check out this article: " + FeedItem.Url
                };

                emailcomposer.Show();
            });

            OpenCommand = new RelayCommand(() =>
            {
                var task = new WebBrowserTask()
                {
                    Uri = new Uri(FeedItem.Url)
                };

                task.Show();
            });
        }
示例#3
0
 public AddFeed(
     IExternalFeedService feedService,
     IFeedDataService feedDataService,
     ILoginService loginService) : base(loginService)
 {
     this.feedService     = feedService;
     this.feedDataService = feedDataService;
 }
示例#4
0
 public CheckFeedsForUpdates(
     IExternalFeedService feedService,
     IFeedDataService feedDataService,
     ILoginService loginService) : base(loginService)
 {
     this.feedService     = feedService;
     this.feedDataService = feedDataService;
 }
示例#5
0
 public GetSummaries(
     IBookmarksDataService bookmarksDataService,
     IFeedDataService feedDataService,
     IJournalDataService journalDataService,
     IJobsDataService jobsDataService,
     ILoginSessionDataService loginSessionDataService,
     ILoginService loginService,
     INotebookDataService notebookDataService,
     IPersonalHealthService personalHealthService,
     IBoardDataService boardDataService,
     IChecklistsDataService checklistsDataService) : base(loginService)
 {
     this.bookmarksDataService    = bookmarksDataService;
     this.feedDataService         = feedDataService;
     this.journalDataService      = journalDataService;
     this.jobsDataService         = jobsDataService;
     this.loginSessionDataService = loginSessionDataService;
     this.notebookDataService     = notebookDataService;
     this.personalHealthService   = personalHealthService;
     this.boardDataService        = boardDataService;
     this.checklistsDataService   = checklistsDataService;
 }
示例#6
0
 public FeedScrapingJob(IConfigurationProvider configuration, ScraperFactory scraperFactory, IFeedDataService dataService)
 {
     _configuration  = configuration;
     _scraperFactory = scraperFactory;
     _dataService    = dataService;
 }
示例#7
0
 public GetFeeds(IFeedDataService dataService, ILoginService loginService) : base(loginService)
 {
     this.dataService = dataService;
 }
示例#8
0
 public MarkItemAsRead(IFeedDataService dataService, ILoginService loginService) : base(loginService)
 {
     this.dataService = dataService;
 }
 public RssFeedProvider(IFeedDataService feedDataService, IConfigurationProvider configuration)
 {
     _feedDataService = feedDataService;
     _configuration   = configuration;
 }
示例#10
0
 public FeedController(
     IFeedDataService feedDataService
     ) : base()
 {
     _feedDataService = feedDataService;
 }
        public MainViewModel(IFeedDataService feedDataService)
        {
            FeedDataService = feedDataService;

            // Configure behaviors

            FeedDataService.PropertyChanged += delegate(Object sender, PropertyChangedEventArgs e)
            {
                if ("RequestsCount" == e.PropertyName)
                {
                    IsLoading = FeedDataService.RequestsCount > 0;
                }
            };

            RefreshCommand = new RelayCommand(() =>
            {
                if (!IsLoading)
                {
                    foreach (var panoramaItem in PanoramaItems)
                    {
                        if (panoramaItem is FeedListPanoramaItemViewModel)
                        {
                            var feedListPanoramaItem = panoramaItem as FeedListPanoramaItemViewModel;
                            feedListPanoramaItem.RefreshCommand.Execute(null);
                        }
                    }
                }
            });

            NavigateToAboutCommand = new RelayCommand(() => Messenger.Default.Send<Uri>(new Uri("/View/About.xaml", UriKind.Relative), "NavigationRequest"));

            // Configure panorama items/data

            var siteLeParisien = new NewsSite()
            {
                Name = "Le parisien",
                ImageUrl = "http://t2.gstatic.com/images?q=tbn:ANd9GcTEo1dBnDfqQpSuHz3qXgUImPbqqyx74rOgv01ZAYbD2oUzq6BG",
                Url = "http://www.leparisien.fr",
                FeedUrl = "http://rss.leparisien.fr/leparisien/rss/actualites-a-la-une.xml"
            };

            var siteLeMonde = new NewsSite()
            {
                Name = "Le monde",
                ImageUrl = "http://t1.gstatic.com/images?q=tbn:ANd9GcQUuiOAOZ_XdyAFEFHpmeD8Bef4S7yXtr8UGRIeO-5qFz7ArlIikA",
                Url = "http://www.lemonde.fr",
                FeedUrl = "http://rss.lemonde.fr/c/205/f/3050/index.rss"
            };

            var siteLeFigaro = new NewsSite()
            {
                Name = "Le Figaro",
                ImageUrl = "http://t1.gstatic.com/images?q=tbn:ANd9GcQQynnyb0aBX5wbcfekFPp-RbgR_NqJ8imXW9y0WkYb0zjj7byN",
                Url = "http://www.lefigaro.fr",
                FeedUrl = "http://rss.lefigaro.fr/lefigaro/laune"
            };

            PanoramaItems = new ObservableCollection<PanoramaItemViewModelBase>()
            {
                new FeedGridPanoramaItemViewModel(FeedDataService),
                new FeedListPanoramaItemViewModel(siteLeParisien, FeedDataService),
                new FeedListPanoramaItemViewModel(siteLeMonde, FeedDataService),
                new FeedListPanoramaItemViewModel(siteLeFigaro, FeedDataService)
            };

            // Trigger the refresh command

            RefreshCommand.Execute(null);
        }
 public FeedGridPanoramaItemViewModel(IFeedDataService feedDataService)
     : base()
 {
     Items = feedDataService.FeedsItems;
     HeaderText = "live";
 }
示例#13
0
 public GetFeedItems(IFeedDataService feedDataService, ILoginService loginService) : base(loginService)
 {
     this.feedDataService = feedDataService;
 }