/// <summary> /// Initializes necessary data /// </summary> private void InitData() { bool dbSuccess = false; try { System.Windows.Forms.Timer timer = new System.Windows.Forms.Timer(); timer.Tick += Timer_Tick; timer.Start(); Player.playbackFinishedEvent += Player_playbackFinishedEventHandler; Player.filePlaybackStartedEvent += Player_filePlaybackStartedEventHandler; dbSuccess = DatabaseInterface.SetupConnection(connectionString); Playlists = DatabaseInterface.GetPlaylists(); SelectedPlaylist = Playlists[0]; } catch { if (dbSuccess == false) { MessageBox.Show("Error trying to set up database connection! You may not be able to save playlists to database.", "Database access error"); } } }
/// <summary> /// Updates list of playlists in playlist control /// </summary> private void RefreshPlaylistsList() { Playlists = DatabaseInterface.GetPlaylists(); RaisePropertyChanged("Playlists"); }