/// <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); }
/// <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); }
/// <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; }
/// <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(); }
/// <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; }