Example #1
0
        public void Export(SDProject sdProject, string outputPath)
        {
            _sdProject  = sdProject;
            _outputPath = outputPath;
            _docCount   = sdProject.DocumentationLanguages.Count;
            _docIndex   = 0;

            foreach (var docLanguage in sdProject.DocumentationLanguages)
            {
                var currentOutputPath = Path.Combine(outputPath, docLanguage);
                _currentDocLanguage = docLanguage;

                ExecuteOnStepMessage(_wordStrings.LoadingTemplate);
                ExecuteOnStepProgress(10);
                var docBuilder = new DocBuilder(_sdProject, _localController.GetLocalStringsOrDefault <WordStrings>(_currentDocLanguage), _currentDocLanguage, currentOutputPath);

                ExecuteOnStepProgress(20);
                ExecuteOnStepMessage(_wordStrings.CreatingDocument);
                docBuilder.BuildDocument();

                ExecuteOnStepProgress(80);
                ExecuteOnStepMessage(_wordStrings.SavingDocument);
                docBuilder.SaveToOutputFolder();

                ExecuteOnStepProgress(90);
                ExecuteOnStepMessage(_wordStrings.DeleteTmp);
                Directory.Delete(Path.Combine(_outputPath, _currentDocLanguage, "tmp"), true);

                _docIndex++;
            }
        }