コード例 #1
0
ファイル: MainWindow.xaml.cs プロジェクト: midwan/amigula
 /// <summary>
 ///     (Re)scan the games directory and refresh the database
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void editMenu_RescanGames_Click(object sender, RoutedEventArgs e)
 {
     if (string.IsNullOrEmpty(Settings.Default.LibraryPath) == false)
         try
         {
             // Call the ProcessDirectory method to handle the selected path
             ProcessDirectory(Settings.Default.LibraryPath);
         }
         catch (Exception ex)
         {
             MessageBox.Show("An exception has occured while trying to scan the games folder!\n\n" + ex.Message,
                 "An exception has occured!", MessageBoxButton.OK, MessageBoxImage.Error);
         }
     else
     {
         var result =
             MessageBox.Show(
                 "You don't have a Games Folder selected in Preferences!\nDo you want to select one now?",
                 "No Games Folder found", MessageBoxButton.YesNo, MessageBoxImage.Question);
         if (result != MessageBoxResult.Yes) return;
         var prefs = new Preferences();
         prefs.Show();
     }
 }
コード例 #2
0
ファイル: MainWindow.xaml.cs プロジェクト: midwan/amigula
 /// <summary>
 ///     Show the preferences Window
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void editMenu_Prefs_Click(object sender, RoutedEventArgs e)
 {
     var prefs = new Preferences();
     prefs.Show();
 }