// --------// /// <summary> /// Settings -button /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void Button_Click_1(object sender, RoutedEventArgs e) { AddCommentsWindow addWindow = new AddCommentsWindow(ref Comments); if (addWindow.ShowDialog() == true) // true, if changed database file path. may modify filename { //filename =Properties.Settings.Default.DBFilename Restore(Properties.Settings.Default.DBFilename); } }
private void Window_Closing(object sender, CancelEventArgs e) { if (System.IO.Path.GetDirectoryName(Properties.Settings.Default.DBFilename).Length == 0) { AddCommentsWindow.GetDBDirectory(this); } if (Comments.Count == 0) { if (MessageBox.Show(Properties.Resources.mw_save, "Info", MessageBoxButton.YesNo, MessageBoxImage.Question) == MessageBoxResult.Yes) { Save(Properties.Settings.Default.DBFilename); } } //Properties.Settings.Default.DBFilename = filename; //Properties.Settings.Default.Save(); }