コード例 #1
0
 private void AddSongToArtist(string artist, string album, Song song)
 {
     if (!Artists.ContainsKey(artist))
     {
         Artists.Add(artist, new Artist(artist));
     }
     Artists[artist].AddSong(album, song);
 }
コード例 #2
0
        private Artist GetOrCreateArtist(string artist)
        {
            string key = artist ?? UnknownArtist;

            if (!Artists.ContainsKey(key))
            {
                Artists[key] = new Artist(key);
            }

            return(Artists[key]);
        }