Exemple #1
0
        private void ExportLocToExcel_Click(object sender, RoutedEventArgs e)
        {
            SaveFileDialog fileDialog = FileDialogFactory <SaveFileDialog> .CreateFileDialog("Select .xlsx file for export", "xlsx");

            if (fileDialog.ShowDialog() == true)
            {
                ExportLocalization.ExportToExcelFile(LocalizationData, fileDialog.FileName);
            }
        }
Exemple #2
0
        private void ExportLocToCsvMenuItem_Click(object sender, RoutedEventArgs e)
        {
            SaveFileDialog fileDialog = FileDialogFactory <SaveFileDialog> .CreateFileDialog("Select .csv file for export", "csv");

            if (fileDialog.ShowDialog() == true)
            {
                ExportLocalization.ExportToCsvFile(LocalizationData, fileDialog.FileName);
            }
        }
Exemple #3
0
        private void ImportCsvMenuItem_Click(object sender, RoutedEventArgs e)
        {
            OpenFileDialog fileDialog = FileDialogFactory <OpenFileDialog> .CreateFileDialog("Select .csv file for import", "csv");

            if (fileDialog.ShowDialog() == true)
            {
                ImportLocalization.ImportCsv(LocalizationData, fileDialog.FileName);
            }
        }
Exemple #4
0
        private void ImportExcelMenuItem_Click(object sender, RoutedEventArgs e)
        {
            OpenFileDialog fileDialog = FileDialogFactory <OpenFileDialog> .CreateFileDialog("Select excel file for import", "xlsx");

            if (fileDialog.ShowDialog() == true)
            {
                ImportLocalization.ImportExcelFileAsync(LocalizationData, fileDialog.FileName);
                CreateProgressWindow();
            }
        }
Exemple #5
0
        private void OpenFileMenuItem_Click(object sender, RoutedEventArgs e)
        {
            LocalizationData.ClearLocalization();
            bool isValidFile = true;

            OpenFileDialog fileDialog = FileDialogFactory <OpenFileDialog> .CreateFileDialog("Select file for opening");

            if (fileDialog.ShowDialog() == true)
            {
                string fileName = fileDialog.FileName;
                string ext      = Path.GetExtension(fileName);

                switch (ext)
                {
                case ".po":
                {
                    ImportLocalization.ImportPoFileAsync(LocalizationData, fileName);
                    CreateProgressWindow();
                }
                break;

                case ".json":
                    ImportLocalization.ImportJson(LocalizationData, fileName);
                    break;

                case ".csv":
                    ImportLocalization.ImportCsv(LocalizationData, fileName);
                    break;

                case ".xlsx":
                {
                    ImportLocalization.ImportExcelFileAsync(LocalizationData, fileName);
                    CreateProgressWindow();
                }
                break;

                default:
                    isValidFile = false;
                    break;
                }
            }
            else
            {
                isValidFile = false;
            }

            if (!isValidFile)
            {
                MessageBox.Show("No valid file or extension is not supported!");
            }
        }