Beispiel #1
0
        /// <summary>
        /// Executes the generation of a help project on the console.
        /// </summary>
        protected void GenerateOnConsole()
        {
            // User interface that will log to the console:
            ConsoleUserInterface ui = new ConsoleUserInterface();

            ui.LogLevel = LogLevel;

            try
            {
                // Read or create the default project
                ChmProject project = ChmProject.OpenChmProjectOrWord(ProjectFile);

                // Check the project
                ChmProjectVerifier verifier = new ChmProjectVerifier(project, false, false);
                if (!verifier.Verifiy())
                {
                    SetAplicationExitCode(ChmLogLevel.ERROR);
                    return;
                }

                // Generate the products
                DocumentProcessor processor = new DocumentProcessor(project, ui);
                processor.GenerateHelp();
                ui.Log("DONE!", ChmLogLevel.INFO);
            }
            catch (Exception ex)
            {
                ui.Log(ex);
                ui.Log("Failed", ChmLogLevel.ERROR);
            }

            // Set the application exit code
            SetAplicationExitCode(ui.MinimumChmLogLevel);
        }