IndexOf

ISummaryZoomSectionCollection.IndexOf method

返回指定 SummaryZoomSection 对象的索引。

public int IndexOf(ISummaryZoomSection summaryZoomSection)
范围类型描述
summaryZoomSectionISummaryZoomSectionSummaryZoomSection 对象找到ISummaryZoomSection

返回值

SummaryZoomSection 对象的索引,如果 SummaryZoomSection 对象不在此集合中,则为 -1。

例子

该示例演示了按索引获取摘要缩放部分元素:

[C#]
using (Presentation pres = new Presentation("pres.pptx"))
{
    ISummaryZoomFrame zoomFrame = (ISummaryZoomFrame) pres.Slides[1].Shapes[0];
    ISummaryZoomSectionCollection collection = zoomFrame.SummaryZoomCollection;
    ISummaryZoomSection selectedObject = collection.GetSummarySection(pres.Sections[2]);
    int idx = collection.IndexOf(selectedObject);
}

也可以看看