Esempio n. 1
0
    private void ImportBtn_Click(object sender, RoutedEventArgs e)
    {
        OpenFileDialog openFileDialog = new();                            // Create an OpenFileDialog

        openFileDialog.Filter = $"{Properties.Resources.GavFiles}|*.gav"; // Extension
        openFileDialog.Title  = Properties.Resources.ImportGames;         // Title

        if (openFileDialog.ShowDialog() ?? true)                          // If the user opend a file
        {
            GameSaver.Import(openFileDialog.FileName, true);              // Import
        }

        FirstRun.ChangePage(Enums.FirstRunPages.SelectImportedGames);         // Change page
    }
Esempio n. 2
0
    private void ImportButton_Click(object sender, RoutedEventArgs e)
    {
        OpenFileDialog openFileDialog = new();                            // Create an OpenFileDialog

        openFileDialog.Filter = $"{Properties.Resources.GavFiles}|*.gav"; // Extension
        openFileDialog.Title  = Properties.Resources.ImportGames;         // Title

        if (openFileDialog.ShowDialog() ?? true)                          // If the user opened a file
        {
            if (MessageBox.Show(Properties.Resources.ImportConfirmMsg, Properties.Resources.MainWindowTitle, MessageBoxButton.YesNo, MessageBoxImage.Exclamation) == MessageBoxResult.Yes)
            {
                GameSaver.Import(openFileDialog.FileName, true);      // Import
                new SelectImportGamesWindow().Show();                 // Show import assistant
            }
        }
    }