/// <summary> /// Get the slides in a given section /// </summary> /// <param name="pDoc">the current presentation document</param> /// <param name="section">the section of interest</param> /// <returns>list of integers representating the slides in each section /// the slides are given by their slide number (one-indexed)</returns> private List<int> GetSlidesInSection(PresentationDocument pDoc, Section section) { var slides = new List<int>(); if (section.SectionSlideIdList == null) { return slides; } List<UInt32Value> slideIds = GetSlideIds(pDoc); foreach (SectionSlideIdListEntry slideId in section.SectionSlideIdList) { int index = slideIds.FindIndex(id => id.Value.Equals(slideId.Id.Value)); if (index != -1) { int slideNumber = index + 1; slides.Add(slideNumber); } } return slides; }
/// <summary> /// Get the name of the section /// </summary> /// <param name="section"></param> /// <returns></returns> private string GetSectionName(Section section) { return section.Name != null && section.Name.HasValue ? section.Name.Value.ToString() : String.Empty; }