Esempio n. 1
0
        /// <summary>
        /// Initializes a new instance of HomeViewModel
        /// </summary>
        /// <param name="dataService"></
        public StatisticViewModel(Data.Models.IDataService dataService)
        {
            this.Configuration = dataService.Configuration;
            this.Header        = dataService.GetSiteHeader();

            this.PodcastSummaries = dataService.GetStatistics();
        }
        /// <summary>
        /// Initializes a new instance of PodcastViewModel
        /// </summary>
        /// <param name="dataService"></
        public PodcastViewModel(Data.Models.IDataService dataService, string shortUrl)
        {
            int id = 0;

            // If the parameter is NOT an numeric ID,
            // Find the #ID associated to this key
            if (!Int32.TryParse(shortUrl, out id))
            {
                int?idFound = dataService.GetPodcastID(shortUrl);
                id = idFound.HasValue ? idFound.Value : 0;
            }

            if (id > 0)
            {
                this.Header        = dataService.GetSocialInformation(id);
                this.Configuration = dataService.Configuration;
                this.Podcast       = dataService.GetPodcast(id);
            }
        }
Esempio n. 3
0
        private const byte _ttl          = 30;      // Default TimeToLive (30 minutes)

        /// <summary>
        /// Initializes a new instance of FeedsViewModel
        /// </summary>
        /// <param name="dataService"></param>
        public FeedsViewModel(Data.Models.IDataService dataService)
        {
            this.Header        = dataService.GetSiteHeader();
            this.Configuration = dataService.Configuration;
            this.Podcasts      = dataService.GetLastPodcasts();
        }