protected override async void PerformExecute() { var file = _dialogCreator.AskForFileToSave("Select markdown file", Constants.Filter.FileFilter("Markdown File", CoreConstants.Filter.MARKDOWN_EXTENSION), Constants.DirectoryKey.REPORT, Subject.Name); if (string.IsNullOrEmpty(file)) { return; } await _markdownReporterTask.SecureAwait(x => _markdownReporterTask.ExportToMarkdown(Subject, file)); }
private InputMapping exportInput(PKSimProject project, QualifcationConfiguration configuration, Input input) { var buildingBlock = project.BuildingBlockByName(input.Name, input.Type); var inputsFolder = configuration.InputsFolder; var projectName = FileHelper.RemoveIllegalCharactersFrom(project.Name); var buildingBlockName = FileHelper.RemoveIllegalCharactersFrom(input.Name); var targetFolder = Path.Combine(inputsFolder, projectName, input.Type.ToString()); DirectoryHelper.CreateDirectory(targetFolder); var fileFullPath = Path.Combine(targetFolder, $"{buildingBlockName}{CoreConstants.Filter.MARKDOWN_EXTENSION}"); // Use wait for now until we can support // run of input _markdownReporterTask.ExportToMarkdown(buildingBlock, fileFullPath, input.SectionLevel).Wait(); _logger.AddDebug($"Input data for {input.Type} '{input.Name}' exported to '{fileFullPath}'", project.Name); return(new InputMapping { SectionId = input.SectionId, Path = relativePath(fileFullPath, configuration.OutputFolder) }); }