Esempio n. 1
0
        public void TestHandleRAndPNodes_RprInsidePpr()
        {
            using (Stream sIn = new FileStream(TESTFILE_DIR + "RAndPhandlersTest2.xml", FileMode.Open))
            {
                ParsingContext context = new ParsingContext();
                context.SetDocumentDefaultContext();

                DocXReaderTestWriter writerOut = new DocXReaderTestWriter(context);
                writerOut.ElementAdded += new EventHandler<TestWriterCallbackInfo>(TestHandleRAndPNodes_RprInsidePpr_OnAddElement);

                context.ParsingBody = true;

                BodyConsumer theBody = new BodyConsumer(context);
                Parser put = new Parser(sIn, theBody, writerOut);

                put.Parse();
            }
        }
Esempio n. 2
0
        public void TestHandlePNode_UseAStyle()
        {
            using (Stream sIn = new FileStream(TESTFILE_DIR + "PhandlerTest2_UseAStyle.xml", FileMode.Open))
            {
                ParsingContext context = new ParsingContext();
                context.SetDefaultStartContext();
                Assert.IsNotNull(context.StyleSheet, "Expected it to be created already");

                Style stylee = new Style();
                stylee.Name = "Heading 2";
                stylee.FCSFormatting = new FCSFormatting();
                stylee.FCSFormatting.ParagraphProperties = new ParagraphProperties();
                stylee.FCSFormatting.ParagraphProperties.SpaceBefore = 300;
                context.StyleSheet.Styles.Add("Heading2", stylee);

                DocXReaderTestWriter writerOut = new DocXReaderTestWriter(context);
                writerOut.ElementAdded += new EventHandler<TestWriterCallbackInfo>(TestHandlePNode_UseAStyle_OnAddElement);

                context.ParsingBody = true;

                BodyConsumer theBody = new BodyConsumer(context);
                Parser put = new Parser(sIn, theBody, writerOut);

                put.Parse();
            }
        }