예제 #1
0
        private void SaveXml_Click(object sender, RoutedEventArgs e)
        {
            //create xml structure
            tree = new TreeBuilder(_openlyricsentity);

            //set filename to song title
            saveFileDialog.FileName = _Title;

            //propt user about location
            var result = saveFileDialog.ShowDialog();

            //Save
            if (result == true)
            {
                //store last save path
                LastSavePath = System.IO.Path.GetDirectoryName(saveFileDialog.FileName);

                //save xml file
                tree.Save(saveFileDialog.FileName);

                //Notify user about transaction
                MessageBox.Show("Fájl sikeresen elmentve", "Mentés eredménye", MessageBoxButton.OK, MessageBoxImage.Information);
            }
        }