Пример #1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="MediaPlayers"/> class.
 /// </summary>
 /// <param name="manager">The manager.</param>
 /// <param name="playerFactory">The player factory.</param>
 /// <param name="repo">The repo.</param>
 /// <param name="devices">The devices.</param>
 /// <param name="dialog">The dialog.</param>
 public MediaPlayers(IMapleLog log, ILocalizationService translationService, IMediaPlayerMapper mediaPlayerMapper, Func <IMediaPlayer> playerFactory, Func <IMediaRepository> repo, AudioDevices devices, DialogViewModel dialog, ISequenceProvider sequenceProvider)
     : base(log, translationService, sequenceProvider)
 {
     _playerFactory     = playerFactory ?? throw new ArgumentNullException(nameof(playerFactory));
     _devices           = devices ?? throw new ArgumentNullException(nameof(devices));
     _dialog            = dialog ?? throw new ArgumentNullException(nameof(dialog));
     _repositoryFactory = repo ?? throw new ArgumentNullException(nameof(repo));
     _mediaPlayerMapper = mediaPlayerMapper ?? throw new ArgumentNullException(nameof(mediaPlayerMapper));
 }
Пример #2
0
        public MediaRepository(IPlaylistMapper playlistMapper, IMediaItemMapper mediaItemMapper, IMediaPlayerMapper mediaPlayerMapper, IPlaylistContext context)
        {
            _context = context ?? throw new ArgumentNullException(nameof(context));

            _mediaItemMapper   = mediaItemMapper ?? throw new ArgumentNullException(nameof(mediaItemMapper));
            _playlistMapper    = playlistMapper ?? throw new ArgumentNullException(nameof(playlistMapper));
            _mediaPlayerMapper = mediaPlayerMapper ?? throw new ArgumentNullException(nameof(mediaPlayerMapper));

            _busyStack            = new BusyStack();
            _busyStack.OnChanged += (hasItems) => { IsBusy = hasItems; };
        }
Пример #3
0
        /// <summary>
        /// Initializes a new instance of the <see cref="MediaPlayers"/> class.
        /// </summary>
        /// <param name="manager">The manager.</param>
        /// <param name="playerFactory">The player factory.</param>
        /// <param name="repositoryFactory">The repo.</param>
        /// <param name="devices">The devices.</param>
        /// <param name="dialog">The dialog.</param>
        public MediaPlayers(ViewModelServiceContainer container,
                            IMediaPlayerMapper mediaPlayerMapper,
                            Func <IMediaPlayer> playerFactory,
                            Func <IMediaRepository> repositoryFactory,
                            AudioDevices devices,
                            DialogViewModel dialog)
            : base(container)
        {
            _playerFactory     = playerFactory ?? throw new ArgumentNullException(nameof(playerFactory), $"{nameof(playerFactory)} {Resources.IsRequired}");
            _devices           = devices ?? throw new ArgumentNullException(nameof(devices), $"{nameof(devices)} {Resources.IsRequired}");
            _dialog            = dialog ?? throw new ArgumentNullException(nameof(dialog), $"{nameof(dialog)} {Resources.IsRequired}");
            _repositoryFactory = repositoryFactory ?? throw new ArgumentNullException(nameof(repositoryFactory), $"{nameof(repositoryFactory)} {Resources.IsRequired}");
            _mediaPlayerMapper = mediaPlayerMapper ?? throw new ArgumentNullException(nameof(mediaPlayerMapper), $"{nameof(mediaPlayerMapper)} {Resources.IsRequired}");

            _notificationService = container.NotificationService;
        }
Пример #4
0
        public MediaRepository(IPlaylistMapper playlistMapper,
                               IMediaItemMapper mediaItemMapper,
                               IMediaPlayerMapper mediaPlayerMapper,
                               IMediaItemRepository mediaItemRepository,
                               IMediaPlayerRepository mediaPlayerRepository,
                               IPlaylistRepository playlistRepository)
        {
            _mediaItemMapper   = mediaItemMapper ?? throw new ArgumentNullException(nameof(mediaItemMapper), $"{nameof(mediaItemMapper)} {Resources.IsRequired}");
            _playlistMapper    = playlistMapper ?? throw new ArgumentNullException(nameof(playlistMapper), $"{nameof(playlistMapper)} {Resources.IsRequired}");
            _mediaPlayerMapper = mediaPlayerMapper ?? throw new ArgumentNullException(nameof(mediaPlayerMapper), $"{nameof(mediaPlayerMapper)} {Resources.IsRequired}");

            _mediaItemRepository   = mediaItemRepository ?? throw new ArgumentNullException(nameof(mediaItemRepository), $"{nameof(mediaItemRepository)} {Resources.IsRequired}");
            _mediaPlayerRepository = mediaPlayerRepository ?? throw new ArgumentNullException(nameof(mediaPlayerRepository), $"{nameof(mediaPlayerRepository)} {Resources.IsRequired}");
            _playlistRepository    = playlistRepository ?? throw new ArgumentNullException(nameof(playlistRepository), $"{nameof(playlistRepository)} {Resources.IsRequired}");

            _busyStack            = new BusyStack();
            _busyStack.OnChanged += (hasItems) => { IsBusy = hasItems; };
        }