コード例 #1
0
        public IParagraph CreateParagraphForRun(IRun run, ParagraphPropertiesModel ppm = null)
        {
            if (run == null)
            {
                throw new ArgumentNullException("run must not be null");
            }

            var paragraph = new Paragraph();

            var platformParagraph = new PlatformParagraph(paragraph);

            if (ppm != null)
            {
                AutoMapper.Mapper.Map(ppm, platformParagraph.ParagraphProperties);
            }

            paragraph.Append(run.ContentItem as Run);

            return(platformParagraph);
        }
コード例 #2
0
        public void Test_Paragraphs_PM()
        {
            ParagraphPropertiesModel testPM = new ParagraphPropertiesModel();

            testPM.NumberingProperties = new NumberingPropertiesModel();
            testPM.NumberingProperties.NumberingLevelReference = 1;
            testPM.NumberingProperties.NumberingId             = 1;
            Assert.AreEqual(testPM.NumberingProperties.NumberingId, testPM.NumberingProperties.NumberingLevelReference);

            testPM.ParagraphStyleId     = new ParagraphStyleIdModel();
            testPM.ParagraphStyleId.Val = "toto";
            Assert.AreEqual("toto", testPM.ParagraphStyleId.Val);

            testPM.SpacingBetweenLines        = new SpacingBetweenLinesModel();
            testPM.SpacingBetweenLines.After  = "toto";
            testPM.SpacingBetweenLines.Before = "toto";
            Assert.AreEqual(testPM.SpacingBetweenLines.After, testPM.SpacingBetweenLines.Before);

            testPM.ParagraphBorders = new ParagraphBordersModel();
            //Assert à mutualiser
        }