當前位置: 首頁>>代碼示例>>C#>>正文


C# PptxDocumentProcessor.GetPresentationPartFilter方法代碼示例

本文整理匯總了C#中Workshare.Fcs.Lite.OfficeOpenXML.PptxDocumentProcessor.GetPresentationPartFilter方法的典型用法代碼示例。如果您正苦於以下問題:C# PptxDocumentProcessor.GetPresentationPartFilter方法的具體用法?C# PptxDocumentProcessor.GetPresentationPartFilter怎麽用?C# PptxDocumentProcessor.GetPresentationPartFilter使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Workshare.Fcs.Lite.OfficeOpenXML.PptxDocumentProcessor的用法示例。


在下文中一共展示了PptxDocumentProcessor.GetPresentationPartFilter方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: TestSorting_SlideOrder

        public void TestSorting_SlideOrder()
        {
            string TEST_PPT = TESTFILE_DIR + "test002.pptx";
            try
            {
                using (PptxDocumentProcessor pdp = new PptxDocumentProcessor(File.Open(TEST_PPT, FileMode.Open)))
                {
                    using (pdp.Output = File.Open(TEST_OUTPUT_FILE, FileMode.CreateNew))
                    {
                        pdp.Process(DocumentProcessingActions.PassThrough);
                    }
                    PptxPresentationPartFilter ppf = pdp.GetPresentationPartFilter() as PptxPresentationPartFilter;
                    Assert.IsNotNull(ppf);
                    List<PartInfo> srpl = ppf.SortedRelatedParts;
                    Assert.AreEqual(9, srpl.Count, "Different number of related parts");

                    PartInfo pi = srpl[0];
                    Assert.AreEqual("rId2", pi.Id);
                    Assert.AreEqual("slides/slide1.xml", pi.Target);
                    pi = srpl[1];
                    Assert.AreEqual("rId3", pi.Id);
                    Assert.AreEqual("slides/slide2.xml", pi.Target);
                    pi = srpl[2];
                    Assert.AreEqual("rId4", pi.Id);
                    Assert.AreEqual("slides/slide3.xml", pi.Target);
                    pi = srpl[3];
                    Assert.AreEqual("rId8", pi.Id);
                    Assert.AreEqual("theme/theme1.xml", pi.Target);
                    pi = srpl[4];
                    Assert.AreEqual("rId7", pi.Id);
                    Assert.AreEqual("viewProps.xml", pi.Target);
                    pi = srpl[5];
                    Assert.AreEqual("rId1", pi.Id);
                    Assert.AreEqual("slideMasters/slideMaster1.xml", pi.Target);
                    pi = srpl[6];
                    Assert.AreEqual("rId6", pi.Id);
                    Assert.AreEqual("presProps.xml", pi.Target);
                    pi = srpl[7];
                    Assert.AreEqual("rId5", pi.Id);
                    Assert.AreEqual("notesMasters/notesMaster1.xml", pi.Target);
                    pi = srpl[8];
                    Assert.AreEqual("rId9", pi.Id);
                    Assert.AreEqual("tableStyles.xml", pi.Target);
                }
            }
            finally
            {
                File.Delete(TEST_OUTPUT_FILE);
            }
       }
開發者ID:killbug2004,項目名稱:WSProf,代碼行數:50,代碼來源:TestPptxPresentationPartFilter.cs

示例2: TestGetSlideRelIdFromPosition

        public void TestGetSlideRelIdFromPosition()
        {
            string TEST_PPT = TESTFILE_DIR + "test002.pptx";
            try
            {
                using (PptxDocumentProcessor pdp = new PptxDocumentProcessor(File.Open(TEST_PPT, FileMode.Open)))
                {
                    using (pdp.Output = File.Open(TEST_OUTPUT_FILE, FileMode.CreateNew))
                    {
                        pdp.Process(DocumentProcessingActions.PassThrough);
                    }
                    PptxPresentationPartFilter ppf = pdp.GetPresentationPartFilter() as PptxPresentationPartFilter;
                    Assert.IsNotNull(ppf);

                    Assert.AreEqual(string.Empty, ppf.GetSlideRelIdFromPosition(0));
                    Assert.AreEqual("rId2", ppf.GetSlideRelIdFromPosition(1));
                    Assert.AreEqual("rId3", ppf.GetSlideRelIdFromPosition(2));
                    Assert.AreEqual("rId4", ppf.GetSlideRelIdFromPosition(3));
                    Assert.AreEqual(string.Empty, ppf.GetSlideRelIdFromPosition(4));
                }
            }
            finally
            {
                File.Delete(TEST_OUTPUT_FILE);
            }
        }
開發者ID:killbug2004,項目名稱:WSProf,代碼行數:26,代碼來源:TestPptxPresentationPartFilter.cs


注:本文中的Workshare.Fcs.Lite.OfficeOpenXML.PptxDocumentProcessor.GetPresentationPartFilter方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。