Interface IMasterSlides
Represents a collection of IMasterSlide instance in a presentation.
Inherited Members
Namespace: Syncfusion.Presentation
Assembly: Syncfusion.Presentation.Base.dll
Syntax
public interface IMasterSlides : IEnumerable<IMasterSlide>, IEnumerable
Properties
Count
Gets the number of elements in the collection. Read-only.
Declaration
int Count { get; }
Property Value
Type | Description |
---|---|
System.Int32 | The total count of the master slides in the master slide collection. |
Examples
//Create a new presentation.
Presentation presentation = Presentation.Create() as Presentation;
//Retrieve the collection of layout Slide
IMasterSlides masterslides = presentation.Masters;
//Get a master by specifying the index in collection
IMasterSlide masterSlide = presentation.Masters[0];
//Add a group shape to master slide
masterSlide.GroupShapes.AddGroupShape(200,234,198,173);
//Add an auto shape - bevel to master slide
masterSlide.Shapes.AddShape(AutoShapeType.Bevel,237,45,187,120);
//Add master slide to the collection
masterslides.Add(masterSlide);
//Get the count of the master slide
int count = masterslides.Count;
//Save the presentation
presentation.Save("Output.pptx");
//Close the presentation
presentation.Close();
Item[Int32]
Gets a IMasterSlide instance from the collection. Read-only.
Declaration
IMasterSlide this[int index] { get; }
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | index | Index from the collection. |
Property Value
Type | Description |
---|---|
IMasterSlide | Returns the particular master slide based on the index. |
Examples
//Create a new presentation.
Presentation presentation = Presentation.Create() as Presentation;
//Retrieve the collection of layout Slide
IMasterSlides masterslides = presentation.Masters;
//Get a master by specifying the index in collection
IMasterSlide masterSlide = presentation.Masters[0];
//Set the fill type for background of the master slide
masterSlide.Background.Fill.FillType = FillType.Solid;
//Set color of the solid fill
masterSlide.Background.Fill.SolidFill.Color = ColorObject.FromArgb(123, 54, 234, 112);
//Add a group shape to master slide
masterSlide.GroupShapes.AddGroupShape(200,234,198,173);
//Save the presentation
presentation.Save("Output.pptx");
//Close the presentation
presentation.Close();
Methods
Add(IMasterSlide)
Adds a master slide at the end of the collection.
Declaration
void Add(IMasterSlide slide)
Parameters
Type | Name | Description |
---|---|---|
IMasterSlide | slide | Represents an IMasterSlide instance to be added. |
Examples
//Create a new presentation.
Presentation presentation = Presentation.Create() as Presentation;
//Retrieve the collection of layout Slide
IMasterSlides masterslides = presentation.Masters;
//Get a master by specifying the index in collection
IMasterSlide masterSlide = presentation.Masters[0];
//Add a group shape to master slide
masterSlide.GroupShapes.AddGroupShape(200,234,198,173);
//Add an auto shape - bevel to master slide
masterSlide.Shapes.AddShape(AutoShapeType.Bevel,237,45,187,120);
//Add master slide to the collection
masterslides.Add(masterSlide);
//Save the presentation
presentation.Save("Output.pptx");
//Close the presentation
presentation.Close();
'Create a new presentation.
Dim presentation__1 As Presentation = TryCast(Presentation.Create(), Presentation)
'Retrieve the collection of layout Slide
Dim masterslides As IMasterSlides = presentation__1.Masters
'Get a master by specifying the index in collection
Dim masterSlide As IMasterSlide = presentation__1.Masters(0)
'Add a group shape to master slide
masterSlide.GroupShapes.AddGroupShape(200, 234, 198, 173)
'Add an auto shape - bevel to master slide
masterSlide.Shapes.AddShape(AutoShapeType.Bevel, 237, 45, 187, 120)
'Add master slide to the collection
masterslides.Add(masterSlide)
'Save the presentation
presentation__1.Save("Output.pptx")
'Close the presentation
presentation__1.Close()
Clear()
Removes all the elements from master slide collection.
Declaration
void Clear()
Examples
//Create a new presentation.
Presentation presentation = Presentation.Create() as Presentation;
//Retrieve the collection of layout Slide
IMasterSlides masterslides = presentation.Masters;
//Get a master by specifying the index in collection
IMasterSlide masterSlide = presentation.Masters[0];
//Clear the master slide collection
masterslides.Clear();
//Add master slide to the collection
masterslides.Add(masterSlide);
//Save the presentation
presentation.Save("Output.pptx");
//Close the presentation
presentation.Close();
'Create a new presentation
Dim presentation__1 As Presentation = TryCast(Presentation.Create(), Presentation)
'Retrieve the collection of layout Slide
Dim masterslides As IMasterSlides = presentation__1.Masters
'Get a master by specifying the index in collection
Dim masterSlide As IMasterSlide = presentation__1.Masters(0)
'Clear the master slide collection
masterslides.Clear()
'Add master slide to the collection
masterslides.Add(masterSlide)
'Save the presentation
presentation__1.Save("Output.pptx")
'Close the presentation
presentation__1.Close()
IndexOf(IMasterSlide)
Returns the zero-based index of the first occurrence of the IMasterSlide instance within the collection.
Declaration
int IndexOf(IMasterSlide slide)
Parameters
Type | Name | Description |
---|---|---|
IMasterSlide | slide | The IMasterSlide instance to locate in the collection. |
Returns
Type | Description |
---|---|
System.Int32 | Returns the zero-based index of the first occurrence of object within the entire collection, if found; otherwise, –1. |
Examples
//Create a new presentation.
Presentation presentation = Presentation.Create() as Presentation;
//Retrieve the collection of layout Slide
IMasterSlides masterslides = presentation.Masters;
//Get a master by specifying the index in collection
IMasterSlide masterSlide = presentation.Masters[0];
//Set the fill type for background of the master slide
masterSlide.Background.Fill.FillType = FillType.Solid;
//Set color of the solid fill
masterSlide.Background.Fill.SolidFill.Color = ColorObject.FromArgb(123, 54, 234, 112);
//Add master slide to the collection
masterslides.Add(masterSlide);
//Get the index of master slide in collection
int index = masterslides.IndexOf(masterSlide);
//Save the presentation
presentation.Save("Output.pptx");
//Close the presentation
presentation.Close();
'Create a new presentation.
Dim presentation__1 As Presentation = TryCast(Presentation.Create(), Presentation)
'Retrieve the collection of layout Slide
Dim masterslides As IMasterSlides = presentation__1.Masters
'Get a master by specifying the index in collection
Dim masterSlide As IMasterSlide = presentation__1.Masters(0)
'Set the fill type for background of the master slide
masterSlide.Background.Fill.FillType = FillType.Solid
'Set color of the solid fill
masterSlide.Background.Fill.SolidFill.Color = ColorObject.FromArgb(123, 54, 234, 112)
'Add master slide to the collection
masterslides.Add(masterSlide)
'Get the index of master slide in collection
Dim index As Integer = masterslides.IndexOf(masterSlide)
'Save the presentation
presentation__1.Save("Output.pptx")
'Close the presentation
presentation__1.Close()
Insert(Int32, IMasterSlide)
Inserts an element into the master slide collection at the specified index.
Declaration
void Insert(int index, IMasterSlide slide)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | index | The zero-based index at which master slide should be inserted. |
IMasterSlide | slide | The master slide item to insert. |
Examples
//Create a new presentation.
Presentation presentation = Presentation.Create() as Presentation;
//Retrieve the collection of layout Slide
IMasterSlides masterslides = presentation.Masters;
//Get a master by specifying the index in collection
IMasterSlide masterSlide = presentation.Masters[0];
//Set the fill type for background of the master slide
masterSlide.Background.Fill.FillType = FillType.Solid;
//Set color of the solid fill
masterSlide.Background.Fill.SolidFill.Color = ColorObject.FromArgb(123, 54, 234, 112);
//Add a group shape to master slide
masterSlide.GroupShapes.AddGroupShape(200,234,198,173);
//Add an auto shape - bevel to master slide
masterSlide.Shapes.AddShape(AutoShapeType.Bevel,237,45,187,120);
//Insert master slide in the collection
masterslides.Insert(1, masterSlide);
//Save the presentation
presentation.Save("Output.pptx");
//Close the presentation
presentation.Close();
'Create a new presentation.
Dim presentation__1 As Presentation = TryCast(Presentation.Create(), Presentation)
'Retrieve the collection of layout Slide
Dim masterslides As IMasterSlides = presentation__1.Masters
'Get a master by specifying the index in collection
Dim masterSlide As IMasterSlide = presentation__1.Masters(0)
'Set the fill type for background of the master slide
masterSlide.Background.Fill.FillType = FillType.Solid
'Set color of the solid fill
masterSlide.Background.Fill.SolidFill.Color = ColorObject.FromArgb(123, 54, 234, 112)
'Add a group shape to master slide
masterSlide.GroupShapes.AddGroupShape(200, 234, 198, 173)
'Add an auto shape - bevel to master slide
masterSlide.Shapes.AddShape(AutoShapeType.Bevel, 237, 45, 187, 120)
'Insert master slide in the collection
masterslides.Insert(1, masterSlide)
'Save the presentation
presentation__1.Save("Output.pptx")
'Close the presentation
presentation__1.Close()
Remove(IMasterSlide)
Removes the first occurrence of a specified IMasterSlide instance from the master slide collection.
Declaration
void Remove(IMasterSlide value)
Parameters
Type | Name | Description |
---|---|---|
IMasterSlide | value | The master slide object to be removed from the collection. |
Examples
//Create a new presentation.
Presentation presentation = Presentation.Create() as Presentation;
//Retrieve the collection of layout Slide
IMasterSlides masterslides = presentation.Masters;
//Get a master by specifying the index in collection
IMasterSlide masterSlide = presentation.Masters[0];
//Add a group shape to master slide
masterSlide.GroupShapes.AddGroupShape(200,234,198,173);
//Insert master slide in the collection
masterslides.Insert(1, masterSlide);
//Remove a specific master slide
masterslides.Remove(masterSlide);
//Save the presentation
presentation.Save("Output.pptx");
//Close the presentation
presentation.Close();
'Create a new presentation.
Dim presentation__1 As Presentation = TryCast(Presentation.Create(), Presentation)
'Retrieve the collection of layout Slide
Dim masterslides As IMasterSlides = presentation__1.Masters
'Get a master by specifying the index in collection
Dim masterSlide As IMasterSlide = presentation__1.Masters(0)
'Add a group shape to master slide
masterSlide.GroupShapes.AddGroupShape(200, 234, 198, 173)
'Insert master slide in the collection
masterslides.Insert(1, masterSlide)
'Remove a specific master slide
masterslides.Remove(masterSlide)
'Save the presentation
presentation__1.Save("Output.pptx")
'Close the presentation
presentation__1.Close()
RemoveAt(Int32)
Removes the element at the specified index of the master slide collection.
Declaration
void RemoveAt(int index)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | index | The zero-based index of the element to be removed. |
Examples
//Create a new presentation.
Presentation presentation = Presentation.Create() as Presentation;
//Retrieve the collection of layout Slide
IMasterSlides masterslides = presentation.Masters;
//Get a master by specifying the index in collection
IMasterSlide masterSlide = presentation.Masters[0];
//Add a group shape to master slide
masterSlide.GroupShapes.AddGroupShape(200,234,198,173);
//Insert master slide in the collection
masterslides.Insert(1, masterSlide);
//Remove a specific master slide
masterslides.RemoveAt(0);
//Save the presentation
presentation.Save("Output.pptx");
//Close the presentation
presentation.Close();
'Create a new presentation
Dim presentation__1 As Presentation = TryCast(Presentation.Create(), Presentation)
'Retrieve the collection of layout Slide
Dim masterslides As IMasterSlides = presentation__1.Masters
'Get a master by specifying the index in collection
Dim masterSlide As IMasterSlide = presentation__1.Masters(0)
'Add a group shape to master slide
masterSlide.GroupShapes.AddGroupShape(200, 234, 198, 173)
'Insert master slide in the collection
masterslides.Insert(1, masterSlide)
'Remove a specific master slide
masterslides.RemoveAt(0)
'Save the presentation
presentation__1.Save("Output.pptx")
'Close the presentation
presentation__1.Close()