/// <summary>
        /// Creates the ViewModels.
        /// </summary>
        /// <param name="windowManager">WindowManager used to display dialogs.</param>
        /// <param name="localFileFactory">Factory used to create <see cref="Data.ILocalFile"/>s.</param>
        /// <param name="fileOperator">FileOperator used to interface with files.</param>
        /// <param name="lastFMClient">Last.fm client.</param>
        /// <param name="discogsClient">Client used to interact with Discogs.com</param>
        /// <param name="fileParserFactory">Factory for creating <see cref="IFileParser"/></param>
        private void CreateViewModels(IExtendedWindowManager windowManager, ILocalFileFactory localFileFactory, IFileOperator fileOperator, ILastFMClient lastFMClient,
                                      IDiscogsDataBaseClient discogsClient, IFileParserFactory fileParserFactory)
        {
            var manualScrobbleViewModel = new ManualScrobbleViewModel(windowManager);

            manualScrobbleViewModel.StatusUpdated += Scrobbler_StatusUpdated;
            var friendScrobbleViewModel = new FriendScrobbleViewModel(windowManager, lastFMClient.User);

            friendScrobbleViewModel.StatusUpdated += Scrobbler_StatusUpdated;
            var databaseScrobbleViewModel = new DatabaseScrobbleViewModel(windowManager, lastFMClient.Artist, lastFMClient.Album, discogsClient);

            databaseScrobbleViewModel.StatusUpdated += Scrobbler_StatusUpdated;
            var csvScrobbleViewModel = new FileParseScrobbleViewModel(windowManager, fileParserFactory, fileOperator);

            csvScrobbleViewModel.StatusUpdated += Scrobbler_StatusUpdated;
            var fileScrobbleViewModel = new FileScrobbleViewModel(windowManager, localFileFactory, fileOperator);

            fileScrobbleViewModel.StatusUpdated += Scrobbler_StatusUpdated;
            var mediaPlayerDatabaseScrobbleViewModel = new MediaPlayerDatabaseScrobbleViewModel(windowManager);

            mediaPlayerDatabaseScrobbleViewModel.StatusUpdated += Scrobbler_StatusUpdated;
            var iTunesScrobbleVM = new ITunesScrobbleViewModel(windowManager, lastFMClient.Track, lastFMClient.Album, lastFMClient.Artist);

            iTunesScrobbleVM.StatusUpdated += Scrobbler_StatusUpdated;
            // todo: put back in once local api is working again
            //var spotifyScrobbleVM = new SpotifyScrobbleViewModel(windowManager, lastFMClient.Track, lastFMClient.Album, lastFMClient.Auth);
            //spotifyScrobbleVM.StatusUpdated += Scrobbler_StatusUpdated;
            var setlistFMScrobbleVM = new SetlistFMScrobbleViewModel(windowManager, lastFMClient.Artist);

            setlistFMScrobbleVM.StatusUpdated += Scrobbler_StatusUpdated;
            var cacheScrobblerVM = new CacheScrobblerViewModel(windowManager);

            cacheScrobblerVM.StatusUpdated += Scrobbler_StatusUpdated;

            ActivateItem(manualScrobbleViewModel);
            ActivateItem(friendScrobbleViewModel);
            ActivateItem(databaseScrobbleViewModel);
            ActivateItem(csvScrobbleViewModel);
            ActivateItem(fileScrobbleViewModel);
            ActivateItem(mediaPlayerDatabaseScrobbleViewModel);
            ActivateItem(iTunesScrobbleVM);
            //ActivateItem(spotifyScrobbleVM);
            ActivateItem(setlistFMScrobbleVM);
            ActivateItem(cacheScrobblerVM);

            // this one should be selected
            ActivateItem(manualScrobbleViewModel);
        }
Example #2
0
        /// <summary>
        /// Creates the ViewModels.
        /// </summary>
        /// <param name="windowManager">WindowManager used to display dialogs.</param>
        /// <param name="localFileFactory">Factory used to create <see cref="ILocalFile"/>s.</param>
        private void CreateViewModels(IExtendedWindowManager windowManager, ILocalFileFactory localFileFactory)
        {
            var manualScrobbleViewModel = new ManualScrobbleViewModel(windowManager);

            manualScrobbleViewModel.StatusUpdated += Scrobbler_StatusUpdated;
            var friendScrobbleViewModel = new FriendScrobbleViewModel(windowManager, MainViewModel.Client.User);

            friendScrobbleViewModel.StatusUpdated += Scrobbler_StatusUpdated;
            var databaseScrobbleViewModel = new DatabaseScrobbleViewModel(windowManager, MainViewModel.Client.Artist, MainViewModel.Client.Album);

            databaseScrobbleViewModel.StatusUpdated += Scrobbler_StatusUpdated;
            var csvScrobbleViewModel = new CSVScrobbleViewModel(windowManager, new CSVTextFieldParserFactory());

            csvScrobbleViewModel.StatusUpdated += Scrobbler_StatusUpdated;
            var fileScrobbleViewModel = new FileScrobbleViewModel(windowManager, localFileFactory);

            fileScrobbleViewModel.StatusUpdated += Scrobbler_StatusUpdated;
            var mediaPlayerDatabaseScrobbleViewModel = new MediaPlayerDatabaseScrobbleViewModel(windowManager);

            mediaPlayerDatabaseScrobbleViewModel.StatusUpdated += Scrobbler_StatusUpdated;
            var iTunesScrobbleVM = new ITunesScrobbleViewModel(windowManager);

            iTunesScrobbleVM.StatusUpdated += Scrobbler_StatusUpdated;
            var spotifyScrobbleVM = new SpotifyScrobbleViewModel(windowManager);

            spotifyScrobbleVM.StatusUpdated += Scrobbler_StatusUpdated;
            var setlistFMScrobbleVM = new SetlistFMScrobbleViewModel(windowManager);

            setlistFMScrobbleVM.StatusUpdated += Scrobbler_StatusUpdated;
            var cacheScrobblerVM = new CacheScrobblerViewModel(windowManager);

            cacheScrobblerVM.StatusUpdated += Scrobbler_StatusUpdated;

            ActivateItem(manualScrobbleViewModel);
            ActivateItem(friendScrobbleViewModel);
            ActivateItem(databaseScrobbleViewModel);
            ActivateItem(csvScrobbleViewModel);
            ActivateItem(fileScrobbleViewModel);
            ActivateItem(mediaPlayerDatabaseScrobbleViewModel);
            ActivateItem(iTunesScrobbleVM);
            ActivateItem(spotifyScrobbleVM);
            ActivateItem(setlistFMScrobbleVM);
            ActivateItem(cacheScrobblerVM);

            // this one should be selected
            ActivateItem(manualScrobbleViewModel);
        }
Example #3
0
        /// <summary>
        /// Creates the ViewModels.
        /// </summary>
        /// <param name="windowManager">WindowManager used to display dialogs.</param>
        /// <param name="localFileFactory">Factory used to create <see cref="Data.ILocalFile"/>s.</param>
        /// <param name="fileOperator">FileOperator used to interface with files.</param>
        /// <param name="lastFMClient">Last.fm client.</param>
        /// <param name="discogsClient">Client used to interact with Discogs.com</param>
        /// <param name="fileParserFactory">Factory for creating <see cref="IFileParser"/></param>
        private ScrobbleViewModelBase[] CreateViewModels(IExtendedWindowManager windowManager, ILocalFileFactory localFileFactory, IFileOperator fileOperator, ILastFMClient lastFMClient,
                                                         IDiscogsDataBaseClient discogsClient, IFileParserFactory fileParserFactory)
        {
            var manualScrobbleViewModel = new ManualScrobbleViewModel(windowManager);

            manualScrobbleViewModel.StatusUpdated += Scrobbler_StatusUpdated;
            var friendScrobbleViewModel = new FriendScrobbleViewModel(windowManager, lastFMClient.User);

            friendScrobbleViewModel.StatusUpdated += Scrobbler_StatusUpdated;
            var databaseScrobbleViewModel = new DatabaseScrobbleViewModel(windowManager, lastFMClient.Artist, lastFMClient.Album, discogsClient);

            databaseScrobbleViewModel.StatusUpdated += Scrobbler_StatusUpdated;
            var csvScrobbleViewModel = new FileParseScrobbleViewModel(windowManager, fileParserFactory, fileOperator);

            csvScrobbleViewModel.StatusUpdated += Scrobbler_StatusUpdated;
            var fileScrobbleViewModel = new FileScrobbleViewModel(windowManager, localFileFactory, fileOperator);

            fileScrobbleViewModel.StatusUpdated += Scrobbler_StatusUpdated;
            var mediaPlayerDatabaseScrobbleViewModel = new MediaPlayerDatabaseScrobbleViewModel(windowManager);

            mediaPlayerDatabaseScrobbleViewModel.StatusUpdated += Scrobbler_StatusUpdated;
            var iTunesScrobbleVM = new ITunesScrobbleViewModel(windowManager, lastFMClient.Track, lastFMClient.Album, lastFMClient.Artist);

            iTunesScrobbleVM.StatusUpdated += Scrobbler_StatusUpdated;
            // todo: put back in once local api is working again
            //var spotifyScrobbleVM = new SpotifyScrobbleViewModel(windowManager, lastFMClient.Track, lastFMClient.Album, lastFMClient.Auth);
            //spotifyScrobbleVM.StatusUpdated += Scrobbler_StatusUpdated;
            var setlistFMScrobbleVM = new SetlistFMScrobbleViewModel(windowManager, lastFMClient.Artist);

            setlistFMScrobbleVM.StatusUpdated += Scrobbler_StatusUpdated;
            var cacheScrobblerVM = new CacheScrobblerViewModel(windowManager);

            cacheScrobblerVM.StatusUpdated += Scrobbler_StatusUpdated;

            return(new ScrobbleViewModelBase[] { manualScrobbleViewModel, friendScrobbleViewModel, databaseScrobbleViewModel, csvScrobbleViewModel,
                                                 fileScrobbleViewModel, mediaPlayerDatabaseScrobbleViewModel, iTunesScrobbleVM, setlistFMScrobbleVM, cacheScrobblerVM });
        }