GemBox.Document
  • Overview
  • Examples
  • Free version
  • Support
  • Pricelist

    Show / Hide Table of Contents

    GradientStopCollection Class

    Namespace:
    GemBox.Document.Drawing
    Assembly:
    GemBox.Document.dll

    Represents a collection of gradient stops in a gradient fill.

    • C#
    • VB.NET
    public class GradientStopCollection : IList<GradientStop>, ICollection<GradientStop>, IEnumerable<GradientStop>, IEnumerable
    Public Class GradientStopCollection
        Implements IList(Of GradientStop), ICollection(Of GradientStop), IEnumerable(Of GradientStop), IEnumerable
    Inheritance:
    System.Object
    GradientStopCollection
    Implements
    System.Collections.Generic.IList<GradientStop>
    System.Collections.Generic.ICollection<GradientStop>
    System.Collections.Generic.IEnumerable<GradientStop>
    System.Collections.IEnumerable

    Properties

    Count

    Gets the number of GradientStops contained in the collection.

    • C#
    • VB.NET
    public int Count { get; }
    Public ReadOnly Property Count As Integer
    Property Value
    System.Int32

    The number of GradientStops contained in the collection.

    Item[Int32]

    Gets or sets the GradientStop at the specified index.

    • C#
    • VB.NET
    public GradientStop this[int index] { get; set; }
    Public Property Item(index As Integer) As GradientStop
    Parameters
    index
    System.Int32

    The zero-based index of the GradientStop to get or set.

    Property Value
    GradientStop

    The GradientStop at the specified index.

    Exceptions
    System.ArgumentOutOfRangeException

    index is less than zero or index is equal to or greater than Count.

    Methods

    Add(GradientStop)

    Adds a GradientStop to the end of the collection.

    • C#
    • VB.NET
    public void Add(GradientStop item)
    Public Sub Add(item As GradientStop)
    Parameters
    item
    GradientStop

    The GradientStop to be added to the end of the collection.

    Exceptions
    System.ArgumentNullException

    item is null.

    AddNew(Double, Color)

    Adds a new gradient stop.

    • C#
    • VB.NET
    public GradientStop AddNew(double position, Color color)
    Public Function AddNew(position As Double, color As Color) As GradientStop
    Parameters
    position
    System.Double

    The position of the gradient stop expressed as a percentage from 0 to 1.

    color
    Color

    The color of the gradient stop.

    Returns
    GradientStop

    A newly added gradient stop.

    Clear()

    Removes all GradientStops from the collection.

    • C#
    • VB.NET
    public void Clear()
    Public Sub Clear

    Contains(GradientStop)

    Determines whether a GradientStop is in the collection.

    • C#
    • VB.NET
    public bool Contains(GradientStop item)
    Public Function Contains(item As GradientStop) As Boolean
    Parameters
    item
    GradientStop

    The GradientStop to locate in the collection.

    Returns
    System.Boolean

    true if item is found in the collection; otherwise, false.

    Exceptions
    System.ArgumentNullException

    item is null.

    GetEnumerator()

    Returns an enumerator that iterates through the GradientStopCollection.

    • C#
    • VB.NET
    public IEnumerator<GradientStop> GetEnumerator()
    Public Function GetEnumerator As IEnumerator(Of GradientStop)
    Returns
    System.Collections.Generic.IEnumerator<GradientStop>

    An System.Collections.Generic.IEnumerator<T> for the collection.

    IndexOf(GradientStop)

    Searches for the specified GradientStop and returns the zero-based index of the first occurrence within the entire collection.

    • C#
    • VB.NET
    public int IndexOf(GradientStop item)
    Public Function IndexOf(item As GradientStop) As Integer
    Parameters
    item
    GradientStop

    The GradientStop to locate in the collection.

    Returns
    System.Int32

    The zero-based index of the first occurrence of item within the entire collection, if found; otherwise, -1.

    Insert(Int32, GradientStop)

    Inserts a GradientStop to the collection at the specified index.

    • C#
    • VB.NET
    public void Insert(int index, GradientStop item)
    Public Sub Insert(index As Integer, item As GradientStop)
    Parameters
    index
    System.Int32

    The zero-based index at which GradientStop should be inserted.

    item
    GradientStop

    The GradientStop to insert into the collection.

    Exceptions
    System.ArgumentOutOfRangeException

    index is less than zero or index is equal to or greater than Count.

    InsertNew(Int32, Double, Color)

    Inserts a new gradient stop with the specified name at the specified index.

    • C#
    • VB.NET
    public GradientStop InsertNew(int index, double position, Color color)
    Public Function InsertNew(index As Integer, position As Double, color As Color) As GradientStop
    Parameters
    index
    System.Int32

    The position in the collection where the new gradient stop should be inserted.

    position
    System.Double

    The position of the gradient stop expressed as a percentage from 0 to 1.

    color
    Color

    The color of the gradient stop.

    Returns
    GradientStop

    A newly inserted gradient stop.

    Exceptions
    System.ArgumentOutOfRangeException

    index is less than 0 or greater than Count.

    Remove(GradientStop)

    Removes the first occurrence of a specific GradientStop from the collection.

    • C#
    • VB.NET
    public bool Remove(GradientStop item)
    Public Function Remove(item As GradientStop) As Boolean
    Parameters
    item
    GradientStop

    The GradientStop to remove from the collection.

    Returns
    System.Boolean

    true if item is successfully removed; otherwise, false. This method also returns false if item was not found in the original collection.

    RemoveAt(Int32)

    Removes the GradientStop at the specified index of the collection.

    • C#
    • VB.NET
    public void RemoveAt(int index)
    Public Sub RemoveAt(index As Integer)
    Parameters
    index
    System.Int32

    The zero-based index of the GradientStop to remove.

    Exceptions
    System.ArgumentOutOfRangeException

    index is less than zero or index is equal to or greater than Count.

    Implements

    System.Collections.Generic.IList<T>
    System.Collections.Generic.ICollection<T>
    System.Collections.Generic.IEnumerable<T>
    System.Collections.IEnumerable
    Back to top

    Facebook • Twitter • LinkedIn

    © GemBox Ltd. — All rights reserved.