Пример #1
0
        /// <summary>
        /// Add the given song to our list of loaded songs, reading
        /// the lyrics of the song from the cache if possible.
        /// </summary>
        /// <param name="song">The newly loaded song</param>
        protected void AddSong(Song song)
        {
            // If we couldn't get the lyrics of the song from the cache, load
            // them from the songs source itself.
            if (this.LyricsCache == null)
            {
                song.GetLyrics();
            }
            else
            {
                if (!this.LyricsCache.UpdateLyrics(song))
                {
                    song.GetLyrics();
                    this.LyricsCache.PutLyrics(song);
                }
            }

            this.Songs.Add(song);
        }
Пример #2
0
        /// <summary>
        /// Add the given song to our list of loaded songs, reading
        /// the lyrics of the song from the cache if possible.
        /// </summary>
        /// <param name="song">The newly loaded song</param>
        protected void AddSong(Song song)
        {
            // If we couldn't get the lyrics of the song from the cache, load
            // them from the songs source itself.
            if (this.LyricsCache == null)
                song.GetLyrics();
            else {
                if (!this.LyricsCache.UpdateLyrics(song)) {
                    song.GetLyrics();
                    this.LyricsCache.PutLyrics(song);
                }
            }

            this.Songs.Add(song);
        }