IndexOf

ISummaryZoomSectionCollection.IndexOf 方法

返回指定 SummaryZoomSection 对象的索引。

public int IndexOf(ISummaryZoomSection summaryZoomSection)
参数类型描述
summaryZoomSectionISummaryZoomSection要查找的 SummaryZoomSection 对象 ISummaryZoomSection

返回值

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

示例

该示例演示通过索引获取 Summary Zoom Section 元素:

[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);
}

参见