Lets assume I have one .ppt file which contains exactly one slide. In code I create two Presentation objects which both have been loaded from that .ppt file.
Each Presentation object now contains a Slide object. These reside in a different location in the memory. Therefore the comparision (slideFromPres1== slideFromPres2) fails --> two different pointers. But the content of these object is evidentially the same.
How can I check if the content of two slides is completely identical? The Equal method of Slide seems not be overridden (the comparision also fails).
Ok. And what if I clone a slide? The cloned slide gets a different SlideId. How can I check if a cloned slide is equal with its original? Or how can I check if two MasterSlides which I added both to the same presentation are same?
Using latest Aspose.Slides for .NET 20.6, you can now compare the two presentation files not only on presentation level but on Master slide level, Layout slide level and Normal slide level. Please try using following example on your end to get to know about usage of feature.
public static void ComaprePresentationSlides()
{
Presentation Src1Pres = new Presentation("Src1.pptx");
Presentation Src2Pres = new Presentation("Src2.pptx");
//Comparing on presentation level
if(Src1Pres.Equals(Src2Pres))
{
Console.WriteLine("Two Presentation files are equal");
}
//Comparing Master slides
if(Src1Pres.Masters[0].Equals(Src2Pres.Masters[0]))
{
Console.WriteLine("Masters are equal.");
}
//Comparing Layout slides
if (Src1Pres.Masters[0].LayoutSlides[0].Equals(Src2Pres.Masters[0].LayoutSlides[0]))
{
Console.WriteLine("Layout are equal.");
}
//Comparing Normal slides
if (Src1Pres.Slides[0].Equals(Src2Pres.Slides[0]))
{
Console.WriteLine("Slides are equal.");
}
}