比较幻灯片
Contents
[
Hide
]
比较两个幻灯片
IBaseSlide 接口和 BaseSlide 类中添加了 Equals 方法。对于结构和静态内容相同的幻灯片 / 布局幻灯片 / 母版幻灯片,它返回 true。
如果所有形状、样式、文本、动画和其他设置等都相同,则两个幻灯片相等。比较不考虑唯一标识符值,例如 SlideId 和动态内容,例如日期占位符中的当前日期值。
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
For complete examples and data files, please go to https://github.com/aspose-slides/Aspose.Slides-for-C | |
// The path to the documents directory. | |
const String templatePath1 = u"../templates/AccessSlides.pptx"; | |
const String templatePath2 = u"../templates/HelloWorld.pptx"; | |
// Instantiate Presentation class | |
SharedPtr<Presentation> presentation1 = MakeObject<Presentation>(templatePath1); | |
SharedPtr<Presentation> presentation2 = MakeObject<Presentation>(templatePath2); | |
for (int i = 0; i < presentation1->get_Masters()->get_Count(); i++) | |
{ | |
for (int j = 0; j <presentation2->get_Masters()->get_Count(); j++) | |
{ | |
if (presentation1->get_Masters()->idx_get(i)->Equals(presentation2->get_Masters()->idx_get(j))) | |
printf("SomePresentation1 MasterSlide# %d is equal to SomePresentation2 MasterSlide #%d : %d\n",i,j); | |
} | |
} | |