当前位置: 首页>>代码示例>>C#>>正文


C# Reader.Execute方法代码示例

本文整理汇总了C#中Reader.Execute方法的典型用法代码示例。如果您正苦于以下问题:C# Reader.Execute方法的具体用法?C# Reader.Execute怎么用?C# Reader.Execute使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Reader的用法示例。


在下文中一共展示了Reader.Execute方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: TestReadSimpleDocx

        public void TestReadSimpleDocx()
        {
            Reader r = new Reader();
            r.Source = new DocumentSource();
            using (r.Source.Data = File.Open(TestFilePath + "test.docx", FileMode.Open))
            {
                r.Consumer = new DummyConsumer();
                r.Execute();


            }

        }
开发者ID:killbug2004,项目名称:WSProf,代码行数:13,代码来源:TestDocxReader.cs

示例2: AssertCompilationSame

        protected void AssertCompilationSame(string refName, Type baseType)
        {
            var xReader = new Reader();
            var xResult = xReader.Execute(baseType.Assembly.Location);
            string xActualOutput;
            using (var xStringWriter = new StringWriter())
            {
                using (var xXmlOut = XmlWriter.Create(xStringWriter))
                {
                    Dump.DumpTypes(xResult, xXmlOut);
                    xXmlOut.Flush();
                    xStringWriter.Flush();
                    xActualOutput = xStringWriter.ToString();
                }
            }

            var xExpectedOutput = ReadAllTextFromStream(baseType.Assembly.GetManifestResourceStream(baseType.Namespace + "." + refName + ".xml"));
            Assert.AreEqual(xExpectedOutput, xActualOutput);
        }
开发者ID:Orvid,项目名称:Cosmos,代码行数:19,代码来源:BaseTest.cs

示例3: TestReadDocxHeaderFooters

        public void TestReadDocxHeaderFooters()
        {
            Reader r = new Reader();
            r.Source = new DocumentSource();
            DummyConsumer consumer = new DummyConsumer();
            using (r.Source.Data = File.Open(TestFilePath + "testheaders.docx", FileMode.Open))
            {
                r.Consumer = consumer;
                r.Execute();


            }


            Assert.AreEqual(16, consumer.Counts["HeaderFooter"]);

            bool bExpectStart = true;
            int iCount = 0;
            foreach (DocElement de in consumer.elements)
            {
                if (de is Section)
                {
                    Assert.IsTrue(de.IsStart, "Expect to get all the hdr/footer stuff done before the end of hte first section");
                }

                if (de is HeaderFooter)
                {
                    Assert.AreEqual(bExpectStart, de.IsStart);
                    bExpectStart = !bExpectStart;
                    iCount++;
                    if (iCount == 12)
                        break;

                }
            }
        }
开发者ID:killbug2004,项目名称:WSProf,代码行数:36,代码来源:TestDocxReader.cs

示例4: ReadDocument

 private static DummyConsumer ReadDocument(string fileName)
 {
     Reader r = new Reader();
     r.Source = new DocumentSource();
     DummyConsumer consumer = new DummyConsumer();
     using (r.Source.Data = File.Open(TestFilePath + fileName, FileMode.Open))
     {
         r.Consumer = consumer;
         r.Execute();
     }
     return consumer;
 }
开发者ID:killbug2004,项目名称:WSProf,代码行数:12,代码来源:TestDocxReader.cs


注:本文中的Reader.Execute方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。