public bool ClosePlaylistQuery()
        {
            if (PlaybackManagerInstance.Playlist.Count <= 0 || !Dirty)
            {
                return(true);
            }
            var dr = MessageBox.Show("Save changes to current playlist?", "Playlist",
                                     MessageBoxButton.YesNoCancel, MessageBoxImage.Question,
                                     MessageBoxResult.Cancel);

            switch (dr)
            {
            case MessageBoxResult.Yes:
            {
                if (CurrentPlaylist != null)
                {
                    TrySavePlaylist(CurrentPlaylist);
                }
                else if (Sfd.ShowDialog() == true)
                {
                    TrySavePlaylist(Sfd.FileName);
                }
                else
                {
                    return(false);
                }
            }
            break;

            case MessageBoxResult.Cancel:
                return(false);
            }

            return(true);
        }
 private void BtnSaveFile_Click(object sender, EventArgs e)
 {
     if (Sfd.ShowDialog() == DialogResult.OK)
     {
         TxtMdtFilePath.Text = Sfd.FileName;
     }
 }
Example #3
0
 private bool SaveAs()
 {
     return(Sfd.ShowDialog(this) == DialogResult.OK && Save(Sfd.FileName));
 }