Exemple #1
0
        public WallpaperOrchestrator(IDependencyResolver dependencyResolver)
        {
            _refreshLock = new object();
            _timer       = new Timer(x =>
            {
                _logger.Debug("Cyclic rotate timer executed");
                RotatePictureForward();
            });
            _monitors    = new List <MonitorWallpaperInformation>();
            _nextMonitor = 0;

            _playlist     = new List <LocalWallpaper>();
            _playlistLast = new List <LocalWallpaper>();

            var threadManager = dependencyResolver.GetInstance <IThreadManager>();
            var logManager    = dependencyResolver.GetInstance <ILogManager>();
            var eventService  = dependencyResolver.GetInstance <IEventService>();

            _logger = logManager.GetLogger <WallpaperOrchestrator>();

            AuthenticationManager = new AuthenticationManager(logManager);
            MonitorsManager       = new MonitorsManager(logManager.GetLogger <MonitorsManager>(), logManager);
            ApiClient             = new WallpaperApiClient(logManager.GetLogger <WallpaperApiClient>(), AuthenticationManager);

            WallpaperManager = new LocalWallpaperManager(logManager.GetLogger <LocalWallpaperManager>(), threadManager, eventService, ApiClient);
            PlaylistManager  = new PlaylistManager(logManager.GetLogger <PlaylistManager>(), ApiClient);
        }
Exemple #2
0
 public WallpaperDownloader(ILogger logger,
                            BlockingCollection <LocalWallpaper> collection,
                            DirectoryInfo cacheDirectory,
                            WallpaperApiClient wallpaperApiClient)
 {
     _logger             = logger;
     _collection         = collection;
     _cacheDirectory     = cacheDirectory;
     _wallpaperApiClient = wallpaperApiClient;
 }
Exemple #3
0
        public LocalWallpaperManager(ILogger logger,
                                     IThreadManager threadManager,
                                     IEventService eventService,
                                     WallpaperApiClient wallpaperApiClient)
        {
            _wallpaper      = new Dictionary <Guid, LocalWallpaper>();
            _cacheDirectory = new DirectoryInfo(
                Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData),
                             "Wallpaper",
                             "ImageCache"));
            _logger             = logger;
            _wallpaperApiClient = wallpaperApiClient;

            _downloaderQueue = new BlockingCollection <LocalWallpaper>();
            _downloader      = new WallpaperDownloader(logger,
                                                       _downloaderQueue,
                                                       _cacheDirectory,
                                                       _wallpaperApiClient);
            threadManager.Start(_downloader);
            eventService.Register(this);
        }
Exemple #4
0
 public PlaylistManager(ILogger logger, WallpaperApiClient wallpaperApiClient)
 {
     _logger             = logger;
     _wallpaperApiClient = wallpaperApiClient;
     _currentPlaylist    = new Queue <PlaylistElement>();
 }