Seal.Forms.ToolsHelper.ExportReportsTranslations C# (CSharp) Méthode

ExportReportsTranslations() public méthode

public ExportReportsTranslations ( ExecutionLogInterface log ) : void
log ExecutionLogInterface
Résultat void
        public void ExportReportsTranslations(ExecutionLogInterface log)
        {
            Repository repository = Repository.Instance.CreateFast();
            StringBuilder translations = new StringBuilder();
            try
            {
                log.Log("Starting the export of the Folders and Reports translations\r\n");
                string separator = System.Globalization.CultureInfo.CurrentCulture.TextInfo.ListSeparator;
                string extraSeparators = initTranslationFile(translations, separator, repository);

                log.Log("Adding folder names in context: FolderName, FolderPath\r\n");
                exportFolderNamesTranslations(repository.ReportsFolder, translations, separator, extraSeparators, repository.ReportsFolder.Length);

                log.Log("Adding file names in context: FileName\r\n");
                exportReportNamesTranslations(repository.ReportsFolder, translations, separator, extraSeparators, repository.ReportsFolder.Length);

                log.Log("Adding report names in context: ReportExecutionName, ReportViewName, ReportOutputName\r\n");
                exportReportsTranslations(log, repository.ReportsFolder, repository, translations, separator, extraSeparators, repository.ReportsFolder.Length);

                string fileName = FileHelper.GetUniqueFileName(Path.Combine(repository.SettingsFolder, "FoldersReportsTranslations_WORK.csv"));
                File.WriteAllText(fileName, translations.ToString(), Encoding.UTF8);

                log.Log("\r\nExport of the Folders and Reports translations terminated.\r\n\r\nThe file has been saved to '{0}' and can be re-worked and merged with the repository translations file.\r\n\r\nNote that the effective repository translations file is 'RepositoryTranslations.csv' in the Repository Sub-Folder 'Settings'.", fileName);

                Process.Start(fileName);
            }
            catch (Exception ex)
            {
                log.Log("\r\n[UNEXPECTED ERROR RECEIVED]\r\n{0}\r\n", ex.Message);
            }
        }