Example #1
0
        // The main conversion action
        public bool Convert(string input, string output, string rootMapFile, bool rename = false, bool deleteExistingOutput = false)
        {
            try {
                // Make sure the output path exists
                VerifyOutputPath(output);

                // Try to load all of the input files
                Collection = new DitaCollection(input);

                // Find the rootmap
                FindRootMap(rootMapFile);

                // Try renaming the files in the collection, if requested
                if (rename)
                {
                    Collection.RenameFiles();
                }

                // Delete and existing output, if asked
                if (deleteExistingOutput)
                {
                    DeleteOutputFiles(output);
                }

                return(true);
            }
            catch (Exception ex) {
                Trace.TraceError(ex);

                return(false);
            }
        }