예제 #1
0
        // --------//


        /// <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);
            }
        }
예제 #2
0
 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();
 }