示例#1
0
        /// <summary>
        ///     Moves a slide, changing its position with the presentation
        /// </summary>
        /// <param name="presentation">PPT.Presentation object instance</param>
        /// <param name="slide">PPT.Slide to move</param>
        /// <param name="destination">Destination location for the slide</param>
        /// <param name="locationIndex">Optional Index for the slides destination</param>
        /// <returns></returns>
        public PPT.Slide MoveSlide(
            PPT.Presentation presentation,
            PPT.Slide slide,
            Locations.Location destination,
            int locationIndex = 0)
        {
            switch (destination)
            {
            case Locations.Location.First:
                slide.MoveTo(1);
                break;

            case Locations.Location.Last:
                slide.MoveTo((presentation.Slides.Count));
                break;

            case Locations.Location.Custom:
                slide.MoveTo(locationIndex);
                break;
            }

            return(slide);
        }