Ejemplo n.º 1
0
 public JavaHelpGenerator(string mainSourceFile, ChmDocument document, UserInterface ui,
                          ChmProject project, HtmlPageDecorator decorator)
     : base(document, ui, project, decorator)
 {
     JavaHelpDirectoryGeneration = Path.Combine(Path.GetTempPath(), Path.GetFileNameWithoutExtension(mainSourceFile)) +
                                   "-javahelp";
 }
Ejemplo n.º 2
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="htmlDoc">The HTML document to parse</param>
 /// <param name="ui">Log generation object</param>
 /// <param name="project">Information about how to split the document</param>
 public ChmDocumentParser(HtmlDocument htmlDoc, UserInterface ui, ChmProject project)
 {
     // Create the empty document:
     Document           = new ChmDocument(htmlDoc);
     UI                 = ui;
     Project            = project;
     ReplaceBrokenLinks = AppSettings.ReplaceBrokenLinks;
 }
Ejemplo n.º 3
0
 protected ContentDirectoryGenerator(ChmDocument document, UserInterface ui,
                                     ChmProject project, HtmlPageDecorator decorator)
 {
     this.Document  = document;
     this.UI        = ui;
     this.Project   = project;
     this.Decorator = decorator;
 }
Ejemplo n.º 4
0
        public ChmGenerator(ChmDocument document, UserInterface ui, ChmProject project,
                            List <string> additionalFiles, HtmlPageDecorator decorator)
            : base(document, ui, project, decorator)
        {
            this.Document        = document;
            this.UI              = ui;
            this.Project         = project;
            this.AdditionalFiles = additionalFiles;

            // Get the encoding and culture for the chm:
            this.HelpWorkshopCulture = project.GetChmCulture(UI);
            this.Encoding            = ChmProject.GetChmEncoding(UI, this.HelpWorkshopCulture);
        }
Ejemplo n.º 5
0
        public GenerationDialog(ChmProject project, bool exitAfterEnd, bool askConfirmations, ChmLogLevel logLevel)
        {
            InitializeComponent();

            this.ExitAfterEnd     = exitAfterEnd;
            this.AskConfirmations = askConfirmations;

            this.UI          = new GenerationDialogUserInterface(this);
            this.UI.LogLevel = logLevel;

            this.Processor = new DocumentProcessor(project, UI);

            BgWorker.RunWorkerAsync();
        }
Ejemplo n.º 6
0
        /// <summary>
        /// Builds the specified file name.
        /// </summary>
        /// <param name="fileName">Name of the file.</param>
        /// <param name="baseUrl">The base URL.</param>
        public void Build(string fileName, string baseUrl)
        {
            filePath        = (Path.IsPathRooted(fileName)) ? fileName : Path.GetPathRoot(fileName);
            projectFilePath = Path.ChangeExtension(filePath, ".hhp");
            string tocFilePath   = Path.ChangeExtension(filePath, ".hhc");
            string indexFilePath = Path.ChangeExtension(filePath, ".hhk");

            string basePath = Path.GetDirectoryName(fileName);

            htmlPath = Path.Combine(basePath, folderNameHtml);

            htmlBuilder.Build(htmlPath, baseUrl);
            errors.AddRange(htmlBuilder.Errors);

            htmlBuilder.TocFile.Save(tocFilePath, destinationEncoding);
            htmlBuilder.IndexFile.Save(indexFilePath, destinationEncoding);


            int basePathLength = (basePath.EndsWith("\\")) ? basePath.Length : basePath.Length + 1;


            var project = new ChmProject
            {
                FilePath         = projectFilePath,
                CompiledFile     = filePath,
                DefaultTopicFile = Path.Combine(folderNameHtml, BaseToHtmlBuilder.DefaultPage),
                ContentsFile     = tocFilePath.Substring(basePathLength),
                IndexFile        = indexFilePath.Substring(basePathLength)
            };

            foreach (var htmlFile in htmlBuilder.GeneratedFiles)
            {
                project.Files.Add(htmlFile.Substring(basePathLength));
            }

            chmBuilder.Build(project);
        }
Ejemplo n.º 7
0
 public PdfGenerator(string mainSourceFilePath, UserInterface ui, ChmProject project)
 {
     this.MainSourceFilePath = mainSourceFilePath;
     this.UI      = ui;
     this.Project = project;
 }
Ejemplo n.º 8
0
 public WebHelpGenerator(ChmDocument document, UserInterface ui, ChmProject project,
                         HtmlPageDecorator decorator)
     : base(document, ui, project, decorator)
 {
 }