Beispiel #1
0
        public MainWindowViewModel()
        {
            var myLock = new object();

            podcasts = new ObservableCollection <Podcast>(podcastService.LoadFromDisk());
            System.Windows.Data.BindingOperations.EnableCollectionSynchronization(podcasts, myLock);
            selectedPodcast = SelectedEpisode?.Podcast;
            selectedEpisode = LastPlayed();

            searchString = string.Empty;

            searchPodcasts = new ObservableCollection <iTunesPodcastFinder.Models.Podcast>();
            System.Windows.Data.BindingOperations.EnableCollectionSynchronization(searchPodcasts, myLock);
            selectedSearchPodcast = null;

            episodeIsPlayingTimer.Elapsed += EpisodeIsPlayingTimer_Elapsed;
            Volume = 1.0f;
        }
Beispiel #2
0
        public Episode(Podcast podcast, string episodeName, Uri episodeUri, string description, double timestamp, DateTime?publishDate, TimeSpan duration, string subtitle, string author, bool isExplicid, string summary, string imageUri, string audioFileSize, string audioFileType, bool isDownloaded, string localPath)
        {
            this.podcast         = podcast;
            this.episodeName     = episodeName;
            this.episodeUri      = episodeUri;
            this.description     = description;
            this.timestamp       = timestamp;
            this.isDownloading   = false;
            this.isDownloaded    = false;
            this.publishDate     = publishDate;
            this.episodeFinished = false;
            this.episodeLength   = duration.TotalSeconds;

            this.subtitle      = subtitle;
            this.author        = author;
            this.isExplicid    = isExplicid;
            this.summary       = summary;
            this.imageUri      = string.IsNullOrEmpty(imageUri) ? podcast.TitleCard : new Uri(imageUri);
            this.audioFileSize = audioFileSize;
            this.audioFileType = audioFileType;
            this.isDownloaded  = isDownloaded;
            this.localPath     = localPath;
        }