コード例 #1
0
        private void SaveSongAs(Song song)
        {
            if (song == null)
                throw new ArgumentNullException("song");

            SaveFilenameDialog dlg = new SaveFilenameDialog(song.Title);
            dlg.Owner = this;

            if (dlg.ShowDialog() == true)
            {
                song.Save(new Uri("song:///" + dlg.Filename));
            }
        }
コード例 #2
0
        private void SaveSong(Song song)
        {
            if (song == null)
                throw new ArgumentNullException("song");

            if (song.Uri == null || song.IsImported)
            {
                SaveSongAs(song);
            }
            else
            {
                song.Save();
            }
        }