menu

WinForms

  • Code Examples
  • Upgrade Guide
  • User Guide
  • Demos
  • Support
  • Forums
  • Download
Interface IMasterSlides - WindowsForms API Reference | Syncfusion

    Show / Hide Table of Contents

    Interface IMasterSlides

    Represents a collection of IMasterSlide instance in a presentation.

    Inherited Members
    System.Collections.Generic.IEnumerable<Syncfusion.Presentation.IMasterSlide>.GetEnumerator()
    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()

    Extension Methods

    EnumerableExtensions.Average<TSource>(IEnumerable<TSource>, Func<TSource, Int16>)
    EnumerableExtensions.Average<TSource>(IEnumerable<TSource>, Func<TSource, Nullable<Int16>>)
    EnumerableExtensions.Sum<TSource>(IEnumerable<TSource>, Func<TSource, Int16>)
    EnumerableExtensions.Sum<TSource>(IEnumerable<TSource>, Func<TSource, Nullable<Int16>>)
    EnumerableExtensions.Max<TSource>(IEnumerable<TSource>, Func<TSource, Int16>)
    EnumerableExtensions.Max<TSource>(IEnumerable<TSource>, Func<TSource, Nullable<Int16>>)
    EnumerableExtensions.Min<TSource>(IEnumerable<TSource>, Func<TSource, Int16>)
    EnumerableExtensions.Min<TSource>(IEnumerable<TSource>, Func<TSource, Nullable<Int16>>)
    EnumerableExtensions.OrderBy<T>(IEnumerable<T>, String, Func<String, Object, Object>)
    EnumerableExtensions.OrderByDescending<T>(IEnumerable<T>, String, Func<String, Object, Object>)
    EnumerableExtensions.OrderBy<T>(IEnumerable<T>, String, Func<String, Object, Object>, IComparer<Object>)
    EnumerableExtensions.OrderByDescending<T>(IEnumerable<T>, String, Func<String, Object, Object>, IComparer<Object>)
    EnumerableExtensions.GetElementType(IEnumerable)
    EnumerableExtensions.GetItemPropertyInfo(IEnumerable)
    FunctionalExtensions.ForEach<T>(IEnumerable, Action<T>)
    FunctionalExtensions.ForEach<T>(IEnumerable<T>, Action<T>)
    FunctionalExtensions.ToList<T>(IEnumerable)
    FunctionalExtensions.IterateIndex<T>(IEnumerable<T>, Action<Int32, T>)
    FunctionalExtensions.IterateIndex<T>(IEnumerable<T>, Action<Int32, T>, Int32)
    FunctionalExtensions.Zip<TFirst, TSecond, TResult>(IEnumerable<TFirst>, IEnumerable<TSecond>, Func<TFirst, TSecond, TResult>)
    FunctionalExtensions.Fold<T, U>(IEnumerable<U>, Func<T, U, T>, T)
    FunctionalExtensions.FoldLeft<T, U>(IEnumerable<U>, Func<T, U, T>, T)
    FunctionalExtensions.FoldRight<T, U>(IEnumerable<U>, Func<T, U, T>, T)
    FunctionalExtensions.ToObservableCollection<T>(IEnumerable<T>)
    QueryableExtensions.OfQueryable(IEnumerable)
    QueryableExtensions.OfQueryable(IEnumerable, Type)
    QueryableExtensions.GroupByMany<TElement>(IEnumerable, Type, List<Func<TElement, Object>>)
    QueryableExtensions.GroupByMany<TElement>(IEnumerable<TElement>, List<SortDescriptor>, IEnumerable<Func<TElement, Object>>)
    QueryableExtensions.GroupByMany<TElement>(IEnumerable<TElement>, List<SortDescriptor>, Dictionary<String, IComparer<Object>>, String[], IEnumerable<Func<TElement, Object>>)
    QueryableExtensions.GroupByMany<TElement>(IEnumerable<TElement>, List<SortDescriptor>, Dictionary<String, IComparer<Object>>, List<String>, Func<TElement, Object>[])
    QueryableExtensions.GroupByMany<TElement>(IEnumerable<TElement>, List<SortDescriptor>, Func<TElement, Object>[])
    QueryableExtensions.GroupByMany<TElement>(IEnumerable<TElement>, Func<TElement, Object>[])
    QueryableExtensions.GroupByMany<TElement>(IEnumerable<TElement>, IEnumerable<Func<TElement, Object>>)
    QueryableExtensions.GroupByMany(IEnumerable, Type, Func<String, Expression>, String[])
    QueryableExtensions.GroupByMany(IEnumerable, Type, List<SortDescriptor>, Dictionary<String, IComparer<Object>>, Func<String, Expression>, String[])
    QueryableExtensions.GroupByMany(IEnumerable, Type, List<SortDescriptor>, Func<String, Expression>, String[])
    PivotExtension.GroupByMany<TElement>(IEnumerable<TElement>, Int32, Func<TElement, Object>[])
    PivotExtension.GroupByMany<TElement>(IEnumerable<TElement>, IEnumerable<Func<TElement, Object>>)
    ChartExtensionUtils.DistinctBy<TSource, TKey>(IEnumerable<TSource>, Func<TSource, TKey>)
    Back to top Generated by DocFX
    Copyright © 2001 - 2025 Syncfusion Inc. All Rights Reserved