In This Article

LinearGradientColorPosition Class

Provides color and position information for a linear gradient.

[TypeConverter(typeof(LinearGradientColorPositionConverter))]
public class LinearGradientColorPosition : ICloneable
Inheritance:
object object
Implements:
ICloneable

Constructors

LinearGradientColorPosition()

Initializes a new instance of the LinearGradientColorPosition class.

public LinearGradientColorPosition()

Remarks

The default constructor initializes all fields to their default values.

LinearGradientColorPosition(LinearGradientColorPosition)

Initializes a new instance of the LinearGradientColorPosition class.

protected LinearGradientColorPosition(LinearGradientColorPosition copyFrom)
Parameter Type Description
copyFrom LinearGradientColorPosition

An instance of LinearGradientColorPosition which will be copied to initialize the new instance.

Remarks

This constructor used in support of Clone().

LinearGradientColorPosition(Color, float)

Initializes a new instance of the LinearGradientColorPosition class.

public LinearGradientColorPosition(Color color, float position)
Parameter Type Description
color Color

The color of the gradient step.

position float

The percentage of distance along the gradient line.

Properties

Color

Gets or sets the color of the gradient step.

public virtual Color Color { get; set; }

Property Value

Color:

A Color object containing the color.

ColorAlpha

Gets or sets the color alpha value.

public virtual byte ColorAlpha { get; set; }

Property Value

byte:

The color alpha value.

Position

Gets or sets the percentage of distance along the gradient line.

public virtual float Position { get; set; }

Property Value

float:

The percentage of distance along the gradient line. This value is a decimal between 0 and 1.

Methods

Clone()

Creates an exact duplicate of the LinearGradientColorPosition object.

public object Clone()

Returns

object:

An exact duplicate of the LinearGradientColorPosition object.

Equals(object)

Determines whether the specified Object is equal to the current Object.

public override bool Equals(object obj)
Parameter Type Description
obj object

The Object to compare to the current Object.

Returns

bool:

true if the specified Object is equal to the current Object; otherwise, false.

GetHashCode()

Returns a hash code for this object.

public override int GetHashCode()

Returns

int:

An integer value that specifies a hash value for this object.

OnPropertyChanged(EventArgs)

Raises the PropertyChanged event.

protected virtual void OnPropertyChanged(EventArgs e)
Parameter Type Description
e EventArgs

An EventArgs that contains the event data.

ResetColor()

Resets the Color property to its default value.

public virtual void ResetColor()

ResetPosition()

Resets the Position property to its default value.

public virtual void ResetPosition()

ShouldSerializeColor()

Indicates whether the Color property should be persisted.

public virtual bool ShouldSerializeColor()

Returns

bool:

true if the property value has changed from its default; otherwise, false.

ShouldSerializePosition()

Indicates whether the Position property should be persisted.

public virtual bool ShouldSerializePosition()

Returns

bool:

true if the property value has changed from its default; otherwise, false.

Events

PropertyChanged

Occurs after a property is changed.

public event EventHandler PropertyChanged

Event Type

EventHandler

Inherited Members