Пример #1
0
        public void ScriptureExportTest()
        {
            string inputSourceDirectory = FileInput("ExportLO");
            string outputDirectory = FileOutput("ExportLO");
            if (Directory.Exists(outputDirectory))
            {
                Directory.Delete(outputDirectory, true);
            }
            FolderTree.Copy(inputSourceDirectory, outputDirectory);
            Param.LoadSettings();
            _projInfo.ProjectPath = outputDirectory;
            _projInfo.ProjectInputType = "Scripture";
            _projInfo.DefaultXhtmlFileWithPath = Common.PathCombine(outputDirectory, "ScriptureInput.xhtml");
            _projInfo.DefaultCssFileWithPath = Common.PathCombine(outputDirectory, "ScriptureInput.css");
            _projInfo.OutputExtension = "odt";
            EnableConfigurationSettings(outputDirectory);

            var target = new ExportLibreOffice();
            const bool expectedResult = true;
            bool actual = target.Export(_projInfo);
            Assert.AreEqual(expectedResult, actual);
        }
Пример #2
0
		private bool LOPreview(PublicationInformation projInfo)
		{
			bool success = false;
			ExportLibreOffice openOffice = new ExportLibreOffice();
			success = openOffice.Export(projInfo);
			return success;
		}
Пример #3
0
        public void MasterDocument()
        {
            ExportLibreOffice exportOpenOffice = new ExportLibreOffice();
            var projInfo = new PublicationInformation();

            CopyInputToOutput();

            string lexiconFull = FileOutput("main.xhtml");
            string revFull = FileOutput("FlexRev.xhtml");
            string lexiconCSS = FileOutput("main.css");
            string revCSS = FileOutput("FLExRev.css");

            ProgressBar pb = new ProgressBar();
            projInfo.ProgressBar = pb;
            //projInfo.ProjectFileWithPath = _projectFile;
            projInfo.IsLexiconSectionExist = File.Exists(lexiconFull);
            projInfo.IsReversalExist = File.Exists(revFull);
            //projInfo.IsReversalExist = Param.Value[Param.ReversalIndex] == "True";
            projInfo.SwapHeadword = false;
            projInfo.FromPlugin = true;
            projInfo.DefaultCssFileWithPath = lexiconCSS;
            projInfo.DefaultRevCssFileWithPath = revCSS;
            projInfo.DefaultXhtmlFileWithPath = lexiconFull;
            projInfo.ProjectInputType = "Dictionary";
            projInfo.DictionaryPath = Path.GetDirectoryName(lexiconFull);
            projInfo.ProjectName = Path.GetFileNameWithoutExtension(lexiconFull);

            exportOpenOffice.Export(projInfo);
            Assert.IsTrue(CheckFileExist(), "Master Document Failed.");

        }
Пример #4
0
        private void button4_Click(object sender, EventArgs e)
        {
            if (!File.Exists(txtInputPath.Text))
            {
                MessageBox.Show("Please enter the valid XHTML path");
                return;
            }

            if (!File.Exists(txtCSSInput.Text))
            {
                MessageBox.Show("Please enter the valid CSS path");
                return;
            }

            ExportLibreOffice exportOdt = new ExportLibreOffice();
            PublicationInformation projInfo = new PublicationInformation();

            string ProjType = "Dictionary";

            if (radScripture.Checked)
            {
                ProjType = "Scripture";
            }


            projInfo.FinalOutput = "odt";
            projInfo.ProjectInputType = ProjType;
            projInfo.ProjectPath = Path.GetDirectoryName(txtInputPath.Text);
            projInfo.DictionaryPath = Path.GetDirectoryName(txtInputPath.Text);
            projInfo.DefaultXhtmlFileWithPath = txtInputPath.Text;
            projInfo.DefaultCssFileWithPath = txtCSSInput.Text;
            projInfo.ProgressBar = new ProgressBar();
            projInfo.DictionaryOutputName = "test";

            ProjType = Common.GetProjectType(projInfo.DefaultXhtmlFileWithPath);
            projInfo.ProjectInputType = ProjType;
            exportOdt.Export(projInfo);
        }