Example #1
0
        public void CreateChm(string chmFile, string title, string locale, Content contentDataSet)
        {
            Chm chm = new Chm(workingDir, title,
                              chmFile, locale, tocControl.Nodes, contentDataSet, links);

            chm.Create();

            ExportProgressForm progressForm = new ExportProgressForm(chm, chm.expectedLines);

            progressForm.ShowDialog();
        }
Example #2
0
        public void CreateHxs(string hxsFile, string title, string copyright, string locale, 
            Content contentDataSet)
        {
            HxS hxs = new HxS(workingDir, hxsFile,
                title, copyright, locale,
                tocControl.Nodes,
                contentDataSet,
                links);

            hxs.Create();

            ExportProgressForm hxsProgressForm = new ExportProgressForm(hxs, hxs.expectedLines);
            hxsProgressForm.ShowDialog();
        }
Example #3
0
        public void CreateMshc(string MshcFile, string locale, Content contentDataSet, string VendorName, string ProdName, string BookName,
            string RootTopicSuffix, string RootTopicParent, bool fTopicVersion, string TopicVersion)
        {
            Mshc mshc = new Mshc(workingDir, MshcFile, locale, tocControl.Nodes, contentDataSet, links, VendorName, ProdName, BookName,
                RootTopicSuffix, RootTopicParent, fTopicVersion, TopicVersion);

            //Mshc.Create();  //progress now calls this.. See Mshc.Compile()

            ExportProgressForm progressForm = new ExportProgressForm(mshc, mshc.expectedLines);
            progressForm.ShowDialog();

        }
Example #4
0
        public void CreateChm(string chmFile, string title, string locale, Content contentDataSet)
        {
            Chm chm = new Chm(workingDir, title,
                chmFile, locale, tocControl.Nodes, contentDataSet, links);

            chm.Create();

            ExportProgressForm progressForm = new ExportProgressForm(chm, chm.expectedLines);
            progressForm.ShowDialog();

        }
Example #5
0
        public void CreateHxs(string hxsFile, string title, string copyright, string locale,
                              Content contentDataSet)
        {
            if (Directory.Exists(hxsDir) == true)
            {
                Directory.Delete(hxsDir, true);
            }

            Directory.CreateDirectory(hxsDir);
            Directory.CreateDirectory(withinHxsDir);

            foreach (string file in Directory.GetFiles(rawDir))
            {
                File.Copy(file, Path.Combine(withinHxsDir, Path.GetFileName(file)), true);
            }

            // This will be used as a base name for forming all of the MSHelp files.
            string baseFilename = Path.GetFileNameWithoutExtension(hxsFile);

            foreach (DataRow row in contentDataSet.Tables["Item"].Rows)
            {
                if (Int32.Parse(row["Size"].ToString()) != 0)
                {
                    Transform(row["ContentId"].ToString(),
                              row["Metadata"].ToString(),
                              row["Annotations"].ToString(),
                              row["VersionId"].ToString(),
                              contentDataSet);
                }
            }


            // Create TOC
            Hxt hxt = new Hxt(Path.Combine(hxsDir, baseFilename + ".hxt"), Encoding.UTF8);

            CreateHxt(tocControl.Nodes, hxt, contentDataSet);
            hxt.Close();


            CreateHxks(baseFilename);

            WriteExtraFiles();

            Hxf hxf = new Hxf(Path.Combine(hxsDir, baseFilename + ".hxf"), Encoding.UTF8);

            string[] files = Directory.GetFiles(hxsDir, "*", SearchOption.AllDirectories);

            foreach (string file in files)
            {
                hxf.WriteLine(file.Replace(hxsDir, ""));
            }

            hxf.Close();

            string lcid = new CultureInfo(locale).LCID.ToString();
            Hxc    hxc  = new Hxc(baseFilename, title, lcid, "1.0", copyright, hxsDir, Encoding.UTF8);

            int numHtmlFiles = Directory.GetFiles(hxsDir, "*.htm", SearchOption.AllDirectories).Length;
            int numFiles     = Directory.GetFiles(hxsDir, "*", SearchOption.AllDirectories).Length;

            // This gives the number of information lines output by the compiler. It
            // was determined experimentally, and should give some means of making an
            // accurate progress bar during a compile.
            // Actual equation is numInfoLines = 2*numHtmlFiles + (numFiles - numHtmlFiles) + 6
            // After factoring, we get this equation
            int expectedLines = numHtmlFiles + numFiles + 6;

            Hxs hxs = new Hxs(Path.Combine(Path.GetFullPath(hxsDir), baseFilename + ".hxc"),
                              Path.GetFullPath(hxsDir),
                              Path.GetFullPath(hxsFile));


            ExportProgressForm hxsProgressForm = new ExportProgressForm(hxs, expectedLines);

            hxsProgressForm.ShowDialog();
        }