本文整理汇总了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);
}
}
示例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);
}
}