Exemplo n.º 1
0
        /// <summary>
        /// Determines whether the specified <see cref="XFGloss.GradientStepCollection"/> is equal to the current <see cref="T:XFGloss.GradientStepCollection"/>.
        /// </summary>
        /// <param name="other">The <see cref="XFGloss.GradientStepCollection"/> to compare with the current <see cref="T:XFGloss.GradientStepCollection"/>.</param>
        /// <returns><c>true</c> if the specified <see cref="XFGloss.GradientStepCollection"/> is equal to the current
        /// <see cref="T:XFGloss.GradientStepCollection"/>; otherwise, <c>false</c>.</returns>
        public bool Equals(GradientStepCollection other)
        {
            if (other == null ||
                other.Count != Count)
            {
                return(false);
            }

            for (int index = 0; index < Count; index++)
            {
                if (!this[index].Equals(other[index]))
                {
                    return(false);
                }
            }

            return(true);
        }
Exemplo n.º 2
0
 /// <summary>
 /// Copy constructor. Will copy the properties of another <see cref="T:XFGloss.Gradient"/> instance to the
 /// newly-constructed one.  The Steps <see cref="T:XFGloss.GradientStepCollection"/> is deeply copied, i.e.,
 /// new <see cref="T:XFGloss.GradientStep"/> instances are constructed using the
 /// <see cref="T:XFGloss.GradientStep"/> copy constructor, then assigned to a new GradientStepCollection
 /// instance.
 /// </summary>
 /// <param name="other">Specifies the other Gradient instance whose properties will be copied to the new instance.</param>
 public Gradient(Gradient other)
 {
     Rotation = other.Rotation;
     Steps    = new GradientStepCollection(other.Steps);
 }
Exemplo n.º 3
0
 /// <summary>
 /// Initializes a new instance of the <see cref="T:XFGloss.Gradient"/> class and creates a multiple step gradient
 /// using the default rotation angle and the provided <see cref="T:XFGloss.GradientStepCollection"/> steps
 /// parameters.
 /// </summary>
 /// <param name="steps">Steps.Specifies a <see cref="T:XFGloss.GradientStepCollection"/> collection of
 /// <see cref="T:XFGloss.GradientStep"/>instances used to specify the color and position of each step in a
 /// multiple step gradient fill.</param>
 public Gradient(GradientStepCollection steps)
 {
     Rotation = DefaultRotation;
     Steps    = steps;
 }
Exemplo n.º 4
0
 /// <summary>
 /// Default constructor. Initializes the steps collection to a new empty collection and the rotation angle to
 /// the default angle, which will fill from top to bottom. Note that the gradient won't be rendered when using
 /// this constructor without adding at least two GradientStep instances to the Steps collection.
 /// </summary>
 public Gradient()
 {
     Steps = new GradientStepCollection();
 }
Exemplo n.º 5
0
 /// <summary>
 /// Initializes a new instance of the <see cref="T:XFGloss.Gradient"/> class and creates a multiple step gradient
 /// using the provided rotation angle and <see cref="T:XFGloss.GradientStepCollection"/> steps parameters.
 /// </summary>
 /// <param name="rotation">Rotation. Specifies an integer number between 0 and 359.</param>
 /// <param name="steps">Steps. Specifies a <see cref="T:XFGloss.GradientStepCollection"/> collection of
 /// <see cref="T:XFGloss.GradientStep"/>instances used to specify the color and position of each step in a
 /// multiple step gradient fill.</param>
 public Gradient(int rotation, GradientStepCollection steps)
 {
     Rotation = rotation;
     Steps    = steps;
 }