Exemplo n.º 1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="PodCastService"/> class.
 /// </summary>
 /// <param name="repositories">The repositories.</param>
 /// <param name="downloader">The downloader.</param>
 /// <exception cref="Uncas.PodCastPlayer.AppServices.ServiceException"></exception>
 public PodCastService(
     IRepositoryFactory repositories,
     IPodCastDownloader downloader)
     : base(
         repositories,
         downloader)
 {
 }
Exemplo n.º 2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="EpisodeService"/> class.
        /// </summary>
        /// <param name="repositories">The repositories.</param>
        /// <param name="downloader">The downloader.</param>
        /// <param name="episodeSaver">The episode saver.</param>
        /// <exception cref="Uncas.PodCastPlayer.AppServices.ServiceException"></exception>
        public EpisodeService(
            IRepositoryFactory repositories,
            IPodCastDownloader downloader,
            IEpisodeSaver episodeSaver)
            : base(repositories, downloader)
        {
            if (episodeSaver == null)
            {
                throw new ServiceException(
                          "Episode saver must be specified.");
            }

            this.saver = episodeSaver;
        }
Exemplo n.º 3
0
        /// <summary>
        /// Initializes a new instance of the <see cref="EpisodeService"/> class.
        /// </summary>
        /// <param name="repositories">The repositories.</param>
        /// <param name="downloader">The downloader.</param>
        /// <param name="episodeSaver">The episode saver.</param>
        /// <exception cref="Uncas.PodCastPlayer.AppServices.ServiceException"></exception>
        public EpisodeService(
            IRepositoryFactory repositories,
            IPodCastDownloader downloader,
            IEpisodeSaver episodeSaver)
            : base(repositories, downloader)
        {
            if (episodeSaver == null)
            {
                throw new ServiceException(
                    "Episode saver must be specified.");
            }

            this.saver = episodeSaver;
        }
Exemplo n.º 4
0
 /// <summary>
 /// Initializes a new instance of the <see cref="App"/> class.
 /// </summary>
 /// <param name="repositories">The repositories.</param>
 /// <param name="downloader">The downloader.</param>
 /// <param name="episodeSaver">The episode saver.</param>
 public App(
     IRepositoryFactory repositories,
     IPodCastDownloader downloader,
     IEpisodeSaver episodeSaver)
 {
     this.backgroundDownloader =
         new BackgroundDownloader(
             repositories,
             downloader,
             episodeSaver);
     this.Startup +=
         this.App_Startup;
     this.DispatcherUnhandledException +=
         App_DispatcherUnhandledException;
 }
Exemplo n.º 5
0
 /// <summary>
 /// Initializes a new instance of the <see cref="App"/> class.
 /// </summary>
 /// <param name="repositories">The repositories.</param>
 /// <param name="downloader">The downloader.</param>
 /// <param name="episodeSaver">The episode saver.</param>
 public App(
     IRepositoryFactory repositories,
     IPodCastDownloader downloader,
     IEpisodeSaver episodeSaver)
 {
     this.backgroundDownloader =
         new BackgroundDownloader(
             repositories,
             downloader,
             episodeSaver);
     this.Startup +=
         this.App_Startup;
     this.DispatcherUnhandledException +=
         App_DispatcherUnhandledException;
 }
Exemplo n.º 6
0
        /// <summary>
        /// Initializes a new instance of the <see cref="BaseService"/> class.
        /// </summary>
        /// <param name="repositories">The repositories.</param>
        /// <param name="downloader">The downloader.</param>
        /// <exception cref="Uncas.PodCastPlayer.AppServices.ServiceException"></exception>
        protected BaseService(
            IRepositoryFactory repositories,
            IPodCastDownloader downloader)
        {
            if (repositories == null)
            {
                throw new ServiceException(
                          "Repositories must be specified.");
            }

            if (downloader == null)
            {
                throw new ServiceException(
                          "Downloader must be specified.");
            }

            this.repositories = repositories;
            this.downloader   = downloader;
        }
Exemplo n.º 7
0
        /// <summary>
        /// Initializes a new instance of the <see cref="BaseService"/> class.
        /// </summary>
        /// <param name="repositories">The repositories.</param>
        /// <param name="downloader">The downloader.</param>
        /// <exception cref="Uncas.PodCastPlayer.AppServices.ServiceException"></exception>
        protected BaseService(
            IRepositoryFactory repositories,
            IPodCastDownloader downloader)
        {
            if (repositories == null)
            {
                throw new ServiceException(
                    "Repositories must be specified.");
            }

            if (downloader == null)
            {
                throw new ServiceException(
                    "Downloader must be specified.");
            }

            this.repositories = repositories;
            this.downloader = downloader;
        }
Exemplo n.º 8
0
        /// <summary>
        /// Initializes a new instance of the <see cref="BackgroundDownloader"/> class.
        /// </summary>
        /// <param name="repositories">The repositories.</param>
        /// <param name="downloader">The downloader.</param>
        /// <param name="episodeSaver">The episode saver.</param>
        public BackgroundDownloader(
            IRepositoryFactory repositories,
            IPodCastDownloader downloader,
            IEpisodeSaver episodeSaver)
        {
            this.repositories = repositories;
            this.downloader   = downloader;
            this.episodeSaver = episodeSaver;
            this.worker       = new BackgroundWorker
            {
                WorkerSupportsCancellation = true
            };
            this.worker.DoWork +=
                this.Worker_DoWork;
            this.worker.RunWorkerCompleted +=
                this.Worker_RunWorkerCompleted;

            this.timer          = new Timer(1000d);
            this.timer.Elapsed +=
                this.Timer_Elapsed;
        }