示例#1
0
 public TagImport(IHorsifySettings horsifySettings)
 {
     _songTagger       = new SongTaggerId3();
     _songTaggerTagLib = new SongTaggerTagLib();
     _horsifyDataRepo  = new HorsifyDataSqliteRepo();
     _horsifySettings  = horsifySettings;
 }
示例#2
0
        /// <summary>
        /// Initializes a new instance of the MainViewModel class.
        /// </summary>
        public MainWindowViewModel(IHorsifySettings horsifySettings, IHorsifyDbConnection horsifyDbConnection) : base(horsifySettings)
        {
            _horsifySettings.Load();

            // Create the database if not exisitng.
            bool createdNewDatabase = horsifyDbConnection.InitDb(_horsifySettings.HorsifyPath).Result;

            if (createdNewDatabase)
            {
                System.Windows.MessageBox.Show($"Database Created.");
            }
        }
示例#3
0
        public FileMenuViewModel(IHorsifySettings horsifySettings, TagImportOption tagImportOption, IEventAggregator eventAggregator)
            : base(horsifySettings)
        {
            _eventAggregator = eventAggregator;
            TagImportOption  = tagImportOption;

            //Commands
            ScanMusicCommand     = new DelegateCommand(OnScanMusic, () => !_isScanRunning);
            StopScanMusicCommand = new DelegateCommand(OnStopScanMusic, () => _isScanRunning);

            //Listen for scan completed event and update commands
            _eventAggregator.GetEvent <ScanSongsEndedEvent>().Subscribe(() =>
            {
                _isScanRunning = false;
                UpdateScanCommandsCanExecute();
            });
        }
示例#4
0
 public ImportViewModelBase(IHorsifySettings horsifySettings)
 {
     _horsifySettings = horsifySettings;
 }