public ArtistViewModel(IArtistMetadataService metadataService,
                               IMusicViewModelFactory viewModelFactory,
                               IMusicFileService musicFileService,
                               IMusicImageUpdater imageUpdater,
                               IProgressManagerViewModel progressManager,
                               IBusyProvider busyProvider,
                               IDialogViewer dialogViewer,
                               IKeyDataStore keyDataStore,
                               string path)
            : base(busyProvider, dialogViewer, viewModelFactory.GetAlbum("dummy", null))
        {
            _metadataService  = metadataService;
            _viewModelFactory = viewModelFactory;
            _musicFileService = musicFileService;
            _busyProvider     = busyProvider;
            Name      = new RequiredPropertyDecorator <string>(new StringCachedPropertyDecorator(keyDataStore, path));
            Path      = path;
            Fanart    = viewModelFactory.GetImage(true, new ArtistFanartImageStrategy(imageUpdater, this));
            Selection = viewModelFactory.GetArtistSelection(this);

            Genres      = new DashDelimitedCollectionViewModel <string>(s => s);
            Moods       = new DashDelimitedCollectionViewModel <string>(s => s);
            Styles      = new DashDelimitedCollectionViewModel <string>(s => s);
            YearsActive = new DashDelimitedCollectionViewModel <int>(int.Parse);

            RefreshCommand = new RefreshMetadataCommand(this);
            UpdateCommand  = new UpdateMetadataCommand(this, progressManager, busyProvider);
            SaveCommand    = new SaveMetadataCommand(this);
            DeleteCommand  = new DeleteMetadataCommand(this);
        }
Esempio n. 2
0
        public MovieViewModel(IMovieMetadataService metadataService,
                              IMovieViewModelFactory viewModelFactory,
                              IFileSystemService fileSystemService,
                              IProgressManagerViewModel progressManager,
                              IBusyProvider busyProvider,
                              IDialogViewer dialogViewer,
                              IKeyDataStore keyDataStore,
                              string path)
            : base(busyProvider, dialogViewer)
        {
            _metadataService   = metadataService;
            _viewModelFactory  = viewModelFactory;
            _fileSystemService = fileSystemService;
            _busyProvider      = busyProvider;
            RefreshCommand     = new RefreshMetadataCommand(this);
            UpdateCommand      = new UpdateMetadataCommand(this, progressManager, busyProvider);
            SaveCommand        = new SaveMetadataCommand(this);
            DeleteCommand      = new DeleteMetadataCommand(this);

            Title = new RequiredPropertyDecorator <string>(new StringCachedPropertyDecorator(keyDataStore, path + "?title"));
            Title.PropertyChanged += TitlePropertyChanged;
            SetName = new StringCachedPropertyDecorator(keyDataStore, path + "?setName");
            SetName.PropertyChanged += TitlePropertyChanged;
            Path         = path;
            Selection    = viewModelFactory.GetSelection(this);
            Poster       = viewModelFactory.GetImage(new PosterImageStrategy(metadataService, this));
            Fanart       = viewModelFactory.GetImage(new FanartImageStrategy(metadataService, this));
            Credits      = new DashDelimitedCollectionViewModel <string>(s => s);
            Directors    = new DashDelimitedCollectionViewModel <string>(s => s);
            Genres       = new DashDelimitedCollectionViewModel <string>(s => s);
            ActorManager = viewModelFactory.GetActorManager(path, () => OnPropertyChanged("ActorManager"));
        }
        public EpisodeViewModel(ITvShowViewModelFactory viewModelFactory,
                                IEpisodeMetadataService metadataService,
                                ITvShowViewModel tvShowViewModel,
                                IProgressManagerViewModel progressManager,
                                IBusyProvider busyProvider,
                                IDialogViewer dialogViewer,
                                IKeyDataStore keyDataStore,
                                string path)
            : base(busyProvider, dialogViewer)
        {
            _metadataService = metadataService;
            _tvShowViewModel = tvShowViewModel;
            _busyProvider    = busyProvider;

            Title = new RequiredPropertyDecorator <string>(new StringCachedPropertyDecorator(keyDataStore, path + "?title"));
            Title.PropertyChanged         += CachedPropertyChanged;
            SeasonNumber                   = new RequiredPropertyDecorator <int?>(new IntCachedPropertyDecorator(keyDataStore, path + "?seasonNumber"));
            SeasonNumber.PropertyChanged  += CachedPropertyChanged;
            EpisodeNumber                  = new RequiredPropertyDecorator <int?>(new IntCachedPropertyDecorator(keyDataStore, path + "?episodeNumber"));
            EpisodeNumber.PropertyChanged += CachedPropertyChanged;
            Path = path;

            Credits   = new DashDelimitedCollectionViewModel <string>(s => s);
            Directors = new DashDelimitedCollectionViewModel <string>(s => s);
            ImagePath = viewModelFactory.GetImage(true);

            RefreshCommand = new RefreshMetadataCommand(this);
            UpdateCommand  = new UpdateMetadataCommand(this, progressManager, busyProvider);
            SaveCommand    = new SaveMetadataCommand(this);
            DeleteCommand  = new DeleteMetadataCommand(this);
        }
Esempio n. 4
0
 protected CachedPropertyDecorator(IKeyDataStore keyDataStore, string propertyKey)
     : base(new PropertyViewModel <T>())
 {
     _keyDataStore = keyDataStore;
     _propertyKey  = propertyKey;
     InitializeValue();
 }
        public TvShowViewModel(ITvShowViewModelFactory viewModelFactory,
                               ITvShowFileService tvShowFileService,
                               ITvShowMetadataService metadataService,
                               IBusyProvider busyProvider,
                               IDialogViewer dialogViewer,
                               IProgressManagerViewModel progressManager,
                               IKeyDataStore keyDataStore,
                               string path)
            : base(busyProvider, dialogViewer)
        {
            _viewModelFactory  = viewModelFactory;
            _tvShowFileService = tvShowFileService;
            _metadataService   = metadataService;
            _busyProvider      = busyProvider;
            Title = new RequiredPropertyDecorator <string>(new StringCachedPropertyDecorator(keyDataStore, path));
            Title.PropertyChanged += TitleValueChanged;
            Path      = path;
            Selection = viewModelFactory.GetTvShowSelection(this);

            RefreshCommand = new RefreshMetadataCommand(this);
            UpdateCommand  = new UpdateMetadataCommand(this, progressManager, busyProvider);
            SaveCommand    = new SaveMetadataCommand(this);
            DeleteCommand  = new DeleteMetadataCommand(this);

            Images       = viewModelFactory.GetTvShowImages(this, path);
            ActorManager = viewModelFactory.GetActorManager(path, () => OnPropertyChanged("ActorManager"));
            Genres       = new DashDelimitedCollectionViewModel <string>(s => s);

            // We need to set a "dummy" item in the collection for an arrow to appear in the TreeView since we're lazy-loading the items under it
            Children.Add(_viewModelFactory.GetSeason(this, "dummy"));
        }
Esempio n. 6
0
        public AlbumViewModel(IMusicFileService musicFileService,
                              IAlbumMetadataService metadataService,
                              IMusicImageUpdater imageUpdater,
                              IMusicViewModelFactory viewModelFactory,
                              IBusyProvider busyProvider,
                              IDialogViewer dialogViewer,
                              IProgressManagerViewModel progressManager,
                              IKeyDataStore keyDataStore,
                              IArtistViewModel artistViewModel,
                              string path)
            : base(busyProvider, dialogViewer, viewModelFactory.GetTrack("dummy"))
        {
            _musicFileService = musicFileService;
            _metadataService  = metadataService;
            _viewModelFactory = viewModelFactory;
            _busyProvider     = busyProvider;
            _artistViewModel  = artistViewModel;
            Title             = new RequiredPropertyDecorator <string>(new StringCachedPropertyDecorator(keyDataStore, path));
            Path      = path;
            CoverArt  = viewModelFactory.GetImage(true, new AlbumCoverArtImageStrategy(imageUpdater, this));
            Selection = viewModelFactory.GetAlbumSelection(this);

            Genres = new DashDelimitedCollectionViewModel <string>(s => s);
            Moods  = new DashDelimitedCollectionViewModel <string>(s => s);
            Styles = new DashDelimitedCollectionViewModel <string>(s => s);
            Themes = new DashDelimitedCollectionViewModel <string>(s => s);

            RefreshCommand = new RefreshMetadataCommand(this);
            UpdateCommand  = new UpdateMetadataCommand(this, progressManager, busyProvider);
            SaveCommand    = new SaveMetadataCommand(this);
            DeleteCommand  = new DeleteMetadataCommand(this);
        }
        public TvShowViewModelTests()
        {
            _viewModelFactory = Substitute.For<ITvShowViewModelFactory>();
            _tvShowFileService = Substitute.For<ITvShowFileService>();
            _metadataService = Substitute.For<ITvShowMetadataService>();
            _busyProvider = Substitute.For<IBusyProvider>();
            _keyDataStore = Substitute.For<IKeyDataStore>();

            _path = @"C:\Folder\TV Shows\Game of Thrones";
            _viewModelFactory = Substitute.For<ITvShowViewModelFactory>();
            IActorManagerViewModel actorManager = Substitute.For<IActorManagerViewModel>();
            actorManager.Actors
                .Returns(new ObservableCollection<IActorViewModel>());
            _viewModelFactory.GetActorManager(_path, Arg.Any<Action>())
                .Returns(actorManager);

            _viewModel = new TvShowViewModel(_viewModelFactory, _tvShowFileService, _metadataService, _busyProvider, null, null, _keyDataStore, _path);
        }
 public MovieViewModelFactory(ISourceService sourceService,
                              IMovieMetadataService metadataService,
                              IFileSystemService fileSystemService,
                              IProgressManagerViewModel progressManager,
                              IKeyDataStore keyDataStore,
                              IBusyProvider busyProvider,
                              IDialogViewer dialogViewer,
                              IActorViewModelFactory actorViewModelFactory)
 {
     _sourceService         = sourceService;
     _fileSystemService     = fileSystemService;
     _metadataService       = metadataService;
     _progressManager       = progressManager;
     _keyDataStore          = keyDataStore;
     _busyProvider          = busyProvider;
     _dialogViewer          = dialogViewer;
     _actorViewModelFactory = actorViewModelFactory;
 }
 public MovieViewModelFactory(ISourceService sourceService,
     IMovieMetadataService metadataService,
     IFileSystemService fileSystemService,
     IProgressManagerViewModel progressManager,
     IKeyDataStore keyDataStore,
     IBusyProvider busyProvider,
     IDialogViewer dialogViewer,
     IActorViewModelFactory actorViewModelFactory)
 {
     _sourceService = sourceService;
     _fileSystemService = fileSystemService;
     _metadataService = metadataService;
     _progressManager = progressManager;
     _keyDataStore = keyDataStore;
     _busyProvider = busyProvider;
     _dialogViewer = dialogViewer;
     _actorViewModelFactory = actorViewModelFactory;
 }
Esempio n. 10
0
        public TvShowViewModelTests()
        {
            _viewModelFactory  = Substitute.For <ITvShowViewModelFactory>();
            _tvShowFileService = Substitute.For <ITvShowFileService>();
            _metadataService   = Substitute.For <ITvShowMetadataService>();
            _busyProvider      = Substitute.For <IBusyProvider>();
            _keyDataStore      = Substitute.For <IKeyDataStore>();

            _path             = @"C:\Folder\TV Shows\Game of Thrones";
            _viewModelFactory = Substitute.For <ITvShowViewModelFactory>();
            IActorManagerViewModel actorManager = Substitute.For <IActorManagerViewModel>();

            actorManager.Actors
            .Returns(new ObservableCollection <IActorViewModel>());
            _viewModelFactory.GetActorManager(_path, Arg.Any <Action>())
            .Returns(actorManager);

            _viewModel = new TvShowViewModel(_viewModelFactory, _tvShowFileService, _metadataService, _busyProvider, null, null, _keyDataStore, _path);
        }
Esempio n. 11
0
        public U2FKeyReferenceImpl([NotNull] X509Certificate vendorCertificate,
            [NotNull] ECPrivateKeyParameters certificatePrivateKey, [NotNull] IKeyPairGenerator keyPairGenerator,
            [NotNull] IKeyHandleGenerator keyHandleGenerator, [NotNull] IKeyDataStore dataStore,
            [NotNull] IUserPresenceVerifier userPresenceVerifier, [NotNull] IKeyCrypto crypto)
        {
            if (vendorCertificate == null)
            {
                throw new ArgumentNullException(nameof(vendorCertificate));
            }
            if (certificatePrivateKey == null)
            {
                throw new ArgumentNullException(nameof(certificatePrivateKey));
            }
            if (keyPairGenerator == null)
            {
                throw new ArgumentNullException(nameof(keyPairGenerator));
            }
            if (keyHandleGenerator == null)
            {
                throw new ArgumentNullException(nameof(keyHandleGenerator));
            }
            if (dataStore == null)
            {
                throw new ArgumentNullException(nameof(dataStore));
            }
            if (userPresenceVerifier == null)
            {
                throw new ArgumentNullException(nameof(userPresenceVerifier));
            }
            if (crypto == null)
            {
                throw new ArgumentNullException(nameof(crypto));
            }

            this.vendorCertificate = vendorCertificate;
            this.certificatePrivateKey = certificatePrivateKey;
            this.keyPairGenerator = keyPairGenerator;
            this.keyHandleGenerator = keyHandleGenerator;
            this.dataStore = dataStore;
            this.userPresenceVerifier = userPresenceVerifier;
            this.crypto = crypto;
        }
Esempio n. 12
0
        public SimulatedU2FKey([NotNull] X509Certificate vendorCertificate,
                               [NotNull] ECPrivateKeyParameters certificatePrivateKey, [NotNull] IKeyPairGenerator keyPairGenerator,
                               [NotNull] IKeyHandleGenerator keyHandleGenerator, [NotNull] IKeyDataStore dataStore,
                               [NotNull] IUserPresenceVerifier userPresenceVerifier, [NotNull] IKeyCrypto crypto)
        {
            if (vendorCertificate == null)
            {
                throw new ArgumentNullException(nameof(vendorCertificate));
            }
            if (certificatePrivateKey == null)
            {
                throw new ArgumentNullException(nameof(certificatePrivateKey));
            }
            if (keyPairGenerator == null)
            {
                throw new ArgumentNullException(nameof(keyPairGenerator));
            }
            if (keyHandleGenerator == null)
            {
                throw new ArgumentNullException(nameof(keyHandleGenerator));
            }
            if (dataStore == null)
            {
                throw new ArgumentNullException(nameof(dataStore));
            }
            if (userPresenceVerifier == null)
            {
                throw new ArgumentNullException(nameof(userPresenceVerifier));
            }
            if (crypto == null)
            {
                throw new ArgumentNullException(nameof(crypto));
            }

            this.vendorCertificate     = vendorCertificate;
            this.certificatePrivateKey = certificatePrivateKey;
            this.keyPairGenerator      = keyPairGenerator;
            this.keyHandleGenerator    = keyHandleGenerator;
            this.dataStore             = dataStore;
            this.userPresenceVerifier  = userPresenceVerifier;
            this.crypto = crypto;
        }
 public TvShowViewModelFactory(ISourceService sourceService,
     IFileSystemService fileSystemService,
     ITvShowFileService tvShowFileService,
     ITvShowMetadataService tvShowMetadataService,
     IEpisodeMetadataService episodeMetadataService,
     IProgressManagerViewModel progressManagerViewModel,
     IKeyDataStore keyDataStore,
     IBusyProvider busyProvider,
     IDialogViewer dialogViewer,
     IActorViewModelFactory actorViewModelFactory)
 {
     _sourceService = sourceService;
     _fileSystemService = fileSystemService;
     _tvShowFileService = tvShowFileService;
     _tvShowMetadataService = tvShowMetadataService;
     _episodeMetadataService = episodeMetadataService;
     _progressManagerViewModel = progressManagerViewModel;
     _keyDataStore = keyDataStore;
     _busyProvider = busyProvider;
     _dialogViewer = dialogViewer;
     _actorViewModelFactory = actorViewModelFactory;
 }
 public TvShowViewModelFactory(ISourceService sourceService,
                               IFileSystemService fileSystemService,
                               ITvShowFileService tvShowFileService,
                               ITvShowMetadataService tvShowMetadataService,
                               IEpisodeMetadataService episodeMetadataService,
                               IProgressManagerViewModel progressManagerViewModel,
                               IKeyDataStore keyDataStore,
                               IBusyProvider busyProvider,
                               IDialogViewer dialogViewer,
                               IActorViewModelFactory actorViewModelFactory)
 {
     _sourceService            = sourceService;
     _fileSystemService        = fileSystemService;
     _tvShowFileService        = tvShowFileService;
     _tvShowMetadataService    = tvShowMetadataService;
     _episodeMetadataService   = episodeMetadataService;
     _progressManagerViewModel = progressManagerViewModel;
     _keyDataStore             = keyDataStore;
     _busyProvider             = busyProvider;
     _dialogViewer             = dialogViewer;
     _actorViewModelFactory    = actorViewModelFactory;
 }
 public MusicViewModelFactory(IArtistMetadataService artistMetadataService,
     IAlbumMetadataService albumMetadataService,
     ISourceService sourceService,
     IFileSystemService fileSystemService,
     IMusicFileService musicFileService,
     IMusicImageService imageService,
     IMusicImageUpdater imageUpdater,
     IBusyProvider busyProvider,
     IKeyDataStore keyDataStore,
     IProgressManagerViewModel progressManager,
     IDialogViewer dialogViewer)
 {
     _artistMetadataService = artistMetadataService;
     _albumMetadataService = albumMetadataService;
     _sourceService = sourceService;
     _fileSystemService = fileSystemService;
     _musicFileService = musicFileService;
     _imageService = imageService;
     _imageUpdater = imageUpdater;
     _busyProvider = busyProvider;
     _keyDataStore = keyDataStore;
     _progressManager = progressManager;
     _dialogViewer = dialogViewer;
 }
Esempio n. 16
0
 public MusicViewModelFactory(IArtistMetadataService artistMetadataService,
                              IAlbumMetadataService albumMetadataService,
                              ISourceService sourceService,
                              IFileSystemService fileSystemService,
                              IMusicFileService musicFileService,
                              IMusicImageService imageService,
                              IMusicImageUpdater imageUpdater,
                              IBusyProvider busyProvider,
                              IKeyDataStore keyDataStore,
                              IProgressManagerViewModel progressManager,
                              IDialogViewer dialogViewer)
 {
     _artistMetadataService = artistMetadataService;
     _albumMetadataService  = albumMetadataService;
     _sourceService         = sourceService;
     _fileSystemService     = fileSystemService;
     _musicFileService      = musicFileService;
     _imageService          = imageService;
     _imageUpdater          = imageUpdater;
     _busyProvider          = busyProvider;
     _keyDataStore          = keyDataStore;
     _progressManager       = progressManager;
     _dialogViewer          = dialogViewer;
 }
 public IntCachedPropertyViewModelTests()
 {
     _keyDataStore = Substitute.For<IKeyDataStore>();
     _key = @"C:\Folder\TV Shows\Adventure Time\Season 1\1x01.mkv?episodeNumber";
     _viewModel = new IntCachedPropertyDecorator(_keyDataStore, _key);
 }
 public StringCachedPropertyViewModelTests()
 {
     _keyDataStore = Substitute.For<IKeyDataStore>();
     _key = @"C:\Folder\TV Shows\Game of Thrones (Complete)";
 }
 public IntCachedPropertyDecorator(IKeyDataStore keyDataStore, string propertyKey)
     : base(keyDataStore, propertyKey)
 {
 }
 public IntCachedPropertyViewModelTests()
 {
     _keyDataStore = Substitute.For <IKeyDataStore>();
     _key          = @"C:\Folder\TV Shows\Adventure Time\Season 1\1x01.mkv?episodeNumber";
     _viewModel    = new IntCachedPropertyDecorator(_keyDataStore, _key);
 }
 public StringCachedPropertyViewModelTests()
 {
     _keyDataStore = Substitute.For <IKeyDataStore>();
     _key          = @"C:\Folder\TV Shows\Game of Thrones (Complete)";
 }