Пример #1
0
        public override void ProcessStep(ChmExporter chmExporter)
        {
            _repository = chmExporter.Repository;
            _currentLanguage = chmExporter.CurrentLanguage;
            _tmpPath = chmExporter.TmpPath;

            chmExporter.ExecuteOnStepProgress(90);
            chmExporter.ExecuteOnStepMessage(chmExporter.ChmStrings.Saving);
            SaveTo(chmExporter.OutputPath, 0);

            chmExporter.ExecuteOnStepProgress(95);
            chmExporter.ExecuteOnStepMessage(chmExporter.ChmStrings.Cleaning);
            CleanUp();

            chmExporter.ExecuteOnStepProgress(100);
            chmExporter.CurrentStep = null;
        }
Пример #2
0
        public override void ProcessStep(ChmExporter chmExporter)
        {
            chmExporter.ExecuteOnStepProgress(0);
            chmExporter.ExecuteOnStepMessage(chmExporter.ChmStrings.Start);

            var contentPath = Path.Combine(Path.GetDirectoryName(GetType().Assembly.Location), "content");
            CopyContentToTmp(chmExporter.Repository.Images, chmExporter.TmpPath, contentPath);

            chmExporter.CurrentStep = new TemplateStep();
        }
Пример #3
0
        public override void ProcessStep(ChmExporter chmExporter)
        {
            chmExporter.ExecuteOnStepProgress(70);
            chmExporter.ExecuteOnStepMessage(chmExporter.ChmStrings.Compiling);

            var p = new Process();
            p.StartInfo.FileName = Path.Combine(chmExporter.TmpPath, "hhc.exe");
            p.StartInfo.Arguments = "\"" + Path.Combine(chmExporter.TmpPath, chmExporter.Repository.ProjectInfo.ProjectName.Replace(" ", "") + ".hhp") + "\"";
            p.StartInfo.UseShellExecute = false;
            p.StartInfo.RedirectStandardOutput = true;
            p.Start();

            p.StandardOutput.ReadToEnd();
            p.WaitForExit();

            chmExporter.CurrentStep = new SaveAndCleanStep();
        }
Пример #4
0
        public override void ProcessStep(ChmExporter chmExporter)
        {
            _tmpFilepath = chmExporter.TmpPath;
            _currentLanguage = chmExporter.CurrentLanguage;
            _repository = chmExporter.Repository;
            _chmConfig = chmExporter.ChmConfig;
            _strings = chmExporter.CurrentStrings;

            chmExporter.ExecuteOnStepProgress(10);
            chmExporter.ExecuteOnStepMessage(chmExporter.ChmStrings.CreateStylesheet);
            CreateStylesheet();

            chmExporter.ExecuteOnStepProgress(15);
            chmExporter.ExecuteOnStepMessage(chmExporter.ChmStrings.CreateIndex);
            CreateIndexFile();

            chmExporter.ExecuteOnStepProgress(20);
            chmExporter.ExecuteOnStepMessage(chmExporter.ChmStrings.CreateToc);
            CreateTocFile();

            chmExporter.ExecuteOnStepProgress(25);
            chmExporter.ExecuteOnStepMessage(chmExporter.ChmStrings.CreateProject);
            CreateProjectFile();

            chmExporter.ExecuteOnStepProgress(30);
            chmExporter.ExecuteOnStepMessage(chmExporter.ChmStrings.CreateArticles);
            CreateArticleFiles();

            chmExporter.ExecuteOnStepProgress(35);
            chmExporter.ExecuteOnStepMessage(chmExporter.ChmStrings.CreateNamespaces);
            CreateNamespaceFiles();

            chmExporter.ExecuteOnStepProgress(40);
            chmExporter.ExecuteOnStepMessage(chmExporter.ChmStrings.CreateTypes);
            CreateTypeFiles();

            chmExporter.ExecuteOnStepProgress(45);
            chmExporter.ExecuteOnStepMessage(chmExporter.ChmStrings.CreateFields);
            CreateFieldFiles();

            chmExporter.ExecuteOnStepProgress(50);
            chmExporter.ExecuteOnStepMessage(chmExporter.ChmStrings.CreateEvents);
            CreateEventFiles();

            chmExporter.ExecuteOnStepProgress(55);
            chmExporter.ExecuteOnStepMessage(chmExporter.ChmStrings.CreateProperties);
            CreatePropertyFiles();

            chmExporter.ExecuteOnStepProgress(60);
            chmExporter.ExecuteOnStepMessage(chmExporter.ChmStrings.CreateMethods);
            CreateMethodFiles();

            chmExporter.CurrentStep = new CompileStep();
        }