Interface ISection
Namespace: Syncfusion.Presentation
Assembly: Syncfusion.Presentation.Base.dll
Syntax
public interface ISection
Properties
Name
Gets or sets the name of the specified section.
Declaration
string Name { get; set; }
Property Value
Type | Description |
---|---|
System.String |
Examples
//Creates a PowerPoint presentation
IPresentation presentation = Presentation.Create();
//Adds a section to the PowerPoint presentation
ISection section = presentation.Sections.Add();
//Sets a name to the created section
section.Name = "SectionDemo";
//Adds a slide to the created section
ISlide slide = section.AddSlide(SlideLayoutType.Blank);
//Adds a text box to the slide
slide.AddTextBox(10, 10, 100, 100).TextBody.AddParagraph("Slide in SectionDemo");
//Saves the PowerPoint presentation
presentation.Save("Section.pptx");
'Creates a PowerPoint presentation
Dim presentation__1 As IPresentation = Presentation.Create()
'Adds a section to the PowerPoint presentation
Dim section As ISection = presentation__1.Sections.Add()
'Sets a name to the created section
section.Name = "SectionDemo"
'Adds a slide to the created section
Dim slide As ISlide = section.AddSlide(SlideLayoutType.Blank)
'Adds a text box to the slide
slide.AddTextBox(10, 10, 100, 100).TextBody.AddParagraph("Slide in SectionDemo")
'Saves the PowerPoint presentation
presentation__1.Save("Section.pptx")
Slides
Gets the slide collection of ISlides instance. Read-only.
Declaration
ISlides Slides { get; }
Property Value
Type | Description |
---|---|
ISlides | Returns the ISlides instance. |
Examples
//Creates a PowerPoint presentation
IPresentation presentation = Presentation.Create();
//Adds a section to the PowerPoint presentation
ISection section = presentation.Sections.Add();
//Sets a name to the created section
section.Name = "SectionDemo";
//Adds a slide to the created section
ISlide slide = section.AddSlide(SlideLayoutType.Blank);
//Adds a text box to the slide
slide.AddTextBox(10, 10, 100, 100).TextBody.AddParagraph("Slide in SectionDemo");
//Gets the collection of slides in the specified section
ISlides slides = section.Slides;
//Saves the PowerPoint presentation
presentation.Save("Section.pptx");
'Creates a PowerPoint presentation
Dim presentation__1 As IPresentation = Presentation.Create()
'Adds a section to the PowerPoint presentation
Dim section As ISection = presentation__1.Sections.Add()
'Sets a name to the created section
section.Name = "SectionDemo"
'Adds a slide to the created section
Dim slide As ISlide = section.AddSlide(SlideLayoutType.Blank)
'Adds a text box to the slide
slide.AddTextBox(10, 10, 100, 100).TextBody.AddParagraph("Slide in SectionDemo")
'Gets the collection of slides in the specified section
Dim slides As ISlides = section.Slides
'Saves the PowerPoint presentation
presentation__1.Save("Section.pptx")
SlidesCount
Gets the number of slides in the specified section. Read-only.
Declaration
int SlidesCount { get; }
Property Value
Type | Description |
---|---|
System.Int32 |
Examples
//Creates a PowerPoint presentation
IPresentation presentation = Presentation.Create();
//Adds a section to the PowerPoint presentation
ISection section = presentation.Sections.Add();
//Sets a name to the created section
section.Name = "SectionDemo";
//Adds a slide to the created section
ISlide slide = section.AddSlide(SlideLayoutType.Blank);
//Adds a text box to the slide
slide.AddTextBox(10, 10, 100, 100).TextBody.AddParagraph("Slide in SectionDemo");
//Gets the number of slides in the specified section
int slidesCount = section.SlidesCount;
//Saves the PowerPoint presentation
presentation.Save("Section.pptx");
'Creates a PowerPoint presentation
Dim presentation__1 As IPresentation = Presentation.Create()
'Adds a section to the PowerPoint presentation
Dim section As ISection = presentation__1.Sections.Add()
'Sets a name to the created section
section.Name = "SectionDemo"
'Adds a slide to the created section
Dim slide As ISlide = section.AddSlide(SlideLayoutType.Blank)
'Adds a text box to the slide
slide.AddTextBox(10, 10, 100, 100).TextBody.AddParagraph("Slide in SectionDemo")
'Gets the number of slides in the specified section
Dim slidesCount As int = section.SlidesCount
'Saves the PowerPoint presentation
presentation__1.Save("Section.pptx")
Methods
AddSlide(SlideLayoutType)
Creates a slide with the specified layout type and adds the new slide to the end of section.
Declaration
ISlide AddSlide(SlideLayoutType slideLayoutType)
Parameters
Type | Name | Description |
---|---|---|
SlideLayoutType | slideLayoutType | Specifies the slide layout type. |
Returns
Type | Description |
---|---|
ISlide | Returns the newly created ISlide instance. |
Examples
//Creates a PowerPoint presentation
IPresentation presentation = Presentation.Create();
//Adds a section to the PowerPoint presentation
ISection section = presentation.Sections.Add();
//Sets a name to the created section
section.Name = "SectionDemo";
//Adds a slide to the created section
ISlide slide = section.AddSlide(SlideLayoutType.Blank);
//Adds a text box to the slide
slide.AddTextBox(10, 10, 100, 100).TextBody.AddParagraph("Slide in SectionDemo");
//Saves the PowerPoint presentation
presentation.Save("Section.pptx");
'Creates a PowerPoint presentation
Dim presentation__1 As IPresentation = Presentation.Create()
'Adds a section to the PowerPoint presentation
Dim section As ISection = presentation__1.Sections.Add()
'Sets a name to the created section
section.Name = "SectionDemo"
'Adds a slide to the created section
Dim slide As ISlide = section.AddSlide(SlideLayoutType.Blank)
'Adds a text box to the slide
slide.AddTextBox(10, 10, 100, 100).TextBody.AddParagraph("Slide in SectionDemo")
'Saves the PowerPoint presentation
presentation__1.Save("Section.pptx")
Clone()
Creates an independent copy of ISlides instance.
Declaration
ISlides Clone()
Returns
Type | Description |
---|---|
ISlides | Returns the ISlides instance. |
Examples
//Creates a PowerPoint presentation1
IPresentation presentation1 = Presentation.Create();
//Creates a PowerPoint presentation2
IPresentation presentation2 = Presentation.Create();
//Adds a section to the PowerPoint presentation
ISection section = presentation1.Sections.Add();
//Adds a slide to the created section
ISlide slide = section.AddSlide(SlideLayoutType.Blank);
//Adds a text box to the slide
slide.AddTextBox(10, 10, 100, 100).TextBody.AddParagraph("Slide in SectionDemo");
//Clones the slides in 3rd section
ISlides slides = presentation1.Sections[0].Clone();
//Iterates the cloned slides and adds the slides to the destination presentation
foreach (ISlide slide1 in slides)
presentation2.Slides.Add(slide1);
//Saves the PowerPoint presentation
presentation2.Save("Section.pptx");
'Creates a PowerPoint presentation1
Dim presentation1 As IPresentation = Presentation.Create()
'Creates a PowerPoint presentation2
Dim presentation2 As IPresentation = Presentation.Create()
'Adds a section to the PowerPoint presentation
Dim section As ISection = presentation1.Sections.Add()
'Adds a slide to the created section
Dim slide As ISlide = section.AddSlide(SlideLayoutType.Blank)
'Adds a text box to the slide
slide.AddTextBox(10, 10, 100, 100).TextBody.AddParagraph("Slide in SectionDemo")
'Clones the slides in 3rd section
Dim slides As ISlides = presentation.Sections(1).Clone()
'Iterates the cloned slides and adds the slides to the destination presentation
For Each slide1 As ISlide In slides
presentation2.Slides.Add(slide1)
Next
'Saves the PowerPoint presentation
presentation2.Save("Section.pptx")
InsertSlide(Int32, ISlide)
Inserts an element into the slide collection at the specified index within the section.
Declaration
void InsertSlide(int slideIndex, ISlide slide)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | slideIndex | The zero-based index at which the section should be inserted. |
ISlide | slide | The section instance to be inserted. |
Examples
//Creates a PowerPoint presentation
IPresentation presentation = Presentation.Create();
//Adds a section to the PowerPoint presentation
ISection section = presentation.Sections.Add();
//Adds a slide to the created section
ISlide slide1 = section.AddSlide(SlideLayoutType.Blank);
//Adds a slide to the created section
ISlide slide2 = section.AddSlide(SlideLayoutType.Blank);
//Insert a slide at the specified index
section.InsertSlide(0,slide2);
//Adds a text box to the slide
slide1.AddTextBox(10, 10, 100, 100).TextBody.AddParagraph("Slide in SectionDemo");
//Saves the PowerPoint presentation
presentation.Save("Section.pptx");
'Creates a PowerPoint presentation
Dim presentation__1 As IPresentation = Presentation.Create()
'Adds a section to the PowerPoint presentation
Dim section As ISection = presentation__1.Sections.Add()
'Sets a name to the created section
section.Name = "SectionDemo"
'Adds a slide to the created section
Dim slide1 As ISlide = section.AddSlide(SlideLayoutType.Blank)
'Adds a slide to the created section
Dim slide2 As ISlide = section.AddSlide(SlideLayoutType.Blank)
//Insert a slide at the specified index
section.InsertSlide(0,slide2);
'Adds a text box to the slide
slide1.AddTextBox(10, 10, 100, 100).TextBody.AddParagraph("Slide in SectionDemo")
'Saves the PowerPoint presentation
presentation__1.Save("Section.pptx")
Move(Int32)
Moves the specified section to the specified index position within the presentation.
Declaration
void Move(int toPosition)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | toPosition | The position at which the section is to be moved. |
Examples
//Creates a PowerPoint presentation
IPresentation presentation = Presentation.Create();
//Adds a section to the PowerPoint presentation
ISection section = presentation.Sections.Add();
//Adds a section to the PowerPoint presentation
presentation.Sections.Add();
//Adds a section to the PowerPoint presentation
presentation.Sections.Add();
//Sets a name to the created section
section.Name = "SectionDemo";
//Adds a slide to the created section
ISlide slide = section.AddSlide(SlideLayoutType.Blank);
//Adds a text box to the slide
slide.AddTextBox(10, 10, 100, 100).TextBody.AddParagraph("Slide in SectionDemo");
// Move the section at the specified index
presentation.Sections[1].Move(2);
//Saves the PowerPoint presentation
presentation.Save("Section.pptx");
'Creates a PowerPoint presentation
Dim presentation__1 As IPresentation = Presentation.Create()
'Adds a section to the PowerPoint presentation
Dim section As ISection = presentation__1.Sections.Add()
'Adds a section to the PowerPoint presentation
presentation__1.Sections.Add()
'Adds a section to the PowerPoint presentation
presentation__1.Sections.Add()
'Sets a name to the created section
section.Name = "SectionDemo"
'Adds a slide to the created section
Dim slide As ISlide = section.AddSlide(SlideLayoutType.Blank)
'Adds a text box to the slide
slide.AddTextBox(10, 10, 100, 100).TextBody.AddParagraph("Slide in SectionDemo")
'Move the section at the specified index
presentation.Sections(2).Move(3)
'Saves the PowerPoint presentation
presentation__1.Save("Section.pptx")