Exemplo n.º 1
0
        /// <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");
                }
            }
        }
Exemplo n.º 2
0
 /// <summary>
 /// Updates list of playlists in playlist control
 /// </summary>
 private void RefreshPlaylistsList()
 {
     Playlists = DatabaseInterface.GetPlaylists();
     RaisePropertyChanged("Playlists");
 }