public MainWindowViewModel()
        {
            string rootPath = "D:\\Projects\\MusicLog\\UserData\\";

            _musicLog = new MusicLogClient(new UserSettings(rootPath + "database.xml", rootPath + "playlist.xml", rootPath + "credentials.xml"));
            RefreshTab(0);
        }
        public TrackLookupTabViewModel(MusicLogClient musicLog)
        {
            _musicLog = musicLog;
            LoadCommands();

            GetArtists(new CustomArtist());
        }
Example #3
0
 public DatabaseTabViewModel(MusicLogClient musicLog)
 {
     _musicLog = musicLog;
     LoadCommands();
     GetDatabaseArtists();
     GetPlaylists();
     PopulatePlaylistMenuItems();
 }
Example #4
0
 public HistoryTabViewModel(MusicLogClient musicLog)
 {
     _musicLog = musicLog;
     LoadCommands();
     HistoryTracks          = new ObservableCollection <KeyValuePair <ITrackViewModel, TrackViewModelParents> >();
     _sortedMusicViewModels = new SortedMusicViewModels();
     GetTracksWithHistory();
 }
        public static ObservableCollection <IArtistViewModel> MakeObservableArtists(MusicLogClient musicLog)
        {
            var artists = new ObservableCollection <IArtistViewModel>();

            foreach (IArtist vanillaArtist in musicLog.GetArtists())
            {
                artists.Add(MakeArtistViewModel(vanillaArtist));
            }
            return(artists);
        }
Example #6
0
        private void axWindowsMediaPlayer1_StatusChange(object sender, EventArgs e)
        {
            Console.WriteLine(DateTime.Now.ToString("HH时mm分ss秒 ffff") + ":" + axWindowsMediaPlayer1.status);
            if ("已停止" == axWindowsMediaPlayer1.status)
            {
                labelStatus.Text = "现时播放音乐:无";

                FormFinishConfirm formFinishConfirm = new FormFinishConfirm(false);
                formFinishConfirm.StartPosition = FormStartPosition.CenterParent;
                formFinishConfirm.ShowDialog();
                var musicLogClient = new MusicLogClient();
                musicLogClient.UpdateLastOneFinishTIme();
            }
        }
        public static ObservableCollection <ITrackViewModel> MakeObservableTracks(IAlbumViewModel album, MusicLogClient musicLog)
        {
            var tracks = new ObservableCollection <ITrackViewModel>();

            foreach (ITrack vanillaTrack in musicLog.GetTracks(album.Album))
            {
                tracks.Add(MakeTrackViewModel(vanillaTrack));
            }
            return(tracks);
        }
        public static ObservableCollection <IAlbumViewModel> MakeObservableAlbums(IArtistViewModel artist, MusicLogClient musicLog)
        {
            var albums = new ObservableCollection <IAlbumViewModel>();

            foreach (IAlbum vanillaAlbum in musicLog.GetAlbums(artist.Artist))
            {
                albums.Add(MakeAlbumViewModel(vanillaAlbum));
            }
            return(albums);
        }
Example #9
0
 public ArtistEntryTabViewModel(MusicLogClient musicLog)
 {
     _musicLog = musicLog;
     LoadCommands();
 }
 public PlaylistTabViewModel(MusicLogClient musicLog)
 {
     _musicLog = musicLog;
     GetPlaylists();
     LoadCommands();
 }