Esempio n. 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++;
            }
        }
        public void Export(SDProject sdProject, string outputPath)
        {
            _docCount = sdProject.DocumentationLanguages.Count;
            _docIndex = 0;
            foreach (var docLanguage in sdProject.DocumentationLanguages)
            {
                StepInput.InitStepinput(sdProject, Path.Combine(outputPath, docLanguage), docLanguage, _localController.GetLocalStringsOrDefault <HtmlStrings>(docLanguage), _htmlStrings, _htmlConfig);

                var steps = new List <StepBase>();
                steps.Add(new PreStep(0, 5));
                steps.Add(new CopyThemeStep(5, 25));
                steps.Add(new CreateDataStep(25, 100));

                foreach (var step in steps)
                {
                    ExecuteOnStepProgress(step.StepRange.ProgressStart);

                    step.OnStepMessage  += ExecuteOnStepMessage;
                    step.OnStepProgress += ExecuteOnStepProgress;
                    step.RunStep();

                    ExecuteOnStepProgress(step.StepRange.ProgressEnd);
                }

                _docIndex++;
            }
        }
Esempio n. 3
0
        public void Export(SDProject sdProject, string outputPath)
        {
            _docCount = sdProject.DocumentationLanguages.Count;
            _docIndex = 0;

            foreach (var targetFx in sdProject.GetAllAvailableTargetFxs())
            {
                if (ApiEmpty(sdProject, targetFx))
                {
                    continue;
                }

                foreach (var docLanguage in sdProject.DocumentationLanguages)
                {
                    StepInput.InitStepinput(sdProject, targetFx, Path.Combine(outputPath, docLanguage), docLanguage, _localController.GetLocalStringsOrDefault <ChmStrings>(docLanguage), _chmStrings, _chmConfig);

                    var steps = new List <StepBase>();
                    steps.Add(new CopyStep(0, 10));
                    steps.Add(new TemplateStep(10, 50));
                    steps.Add(new CompileStep(50, 90));
                    steps.Add(new SaveAndCleanStep(90, 100));

                    foreach (var step in steps)
                    {
                        ExecuteOnStepProgress(step.StepRange.ProgressStart);

                        step.OnStepMessage  += ExecuteOnStepMessage;
                        step.OnStepProgress += ExecuteOnStepProgress;
                        step.RunStep();
                    }

                    _docIndex++;
                }
            }
        }