DashStyle

References
public sealed class DashStyle : IEquatable<DashStyle>
Dash style for a Pen
Pen.DashStyle

Constructors

DashStyle

#
public DashStyle(float offset, params float[] dashes)
Initializes a new instance of the DashStyle class.
offset (float)Offset of the first dash in the style
dashes (params float[])Dashes to use for the style. See Dashes

Properties

Dashes

#
public float[] Dashes { get; }
Gets the dashes and gaps for this style
Remarks: The values specified are the dash lengths and gap lengths in alternating order. The lengths are multiplied by the thickness of the pen. For example, values of 2, 1 would have a dash of (2 * thickness) followed by a gap of (1 * thickness).
The dashes to use for a pen

IsSolid

#
public bool IsSolid { get; }
Gets a value indicating whether this dash style is solid

Offset

#
public float Offset { get; }
Gets the offset of the first dash
Remarks: A value of 1 indicates that the first dash should start at the (1*thickness) of the pen.
The offset of the first dash, in multiples of pen thickness

Methods

Equals

#
public bool Equals(DashStyle other)
Determines whether the specified DashStyle is equal to the current DashStyle.
other (DashStyle)The DashStyle to compare with the current DashStyle.
true if the specified DashStyle is equal to the current DashStyle; otherwise, false.

Equals

#
public override bool Equals(object obj)
Determines whether the specified object is equal to the current DashStyle.
obj (object)The object to compare with the current DashStyle.
true if the specified object is equal to the current DashStyle; otherwise, false.
Object.Equals

GetHashCode

#
public override int GetHashCode()
Serves as a hash function for a DashStyle object.
A hash code for this instance that is suitable for use in hashing algorithms and data structures such as a hash table.

Parse

#
public static DashStyle Parse(string value)
Attempts to parse the specified value into a dash style. This can be one of the system styles (solid, dash, dot, dashdot, dashdotdot), or a series of numbers separated by commas specifying the solid and gap parts (see Dashes).
value (string)String value to parse
DashStyle representation of the specified value if successful
ArgumentOutOfRangeExceptionRaised when the value could not be converted

ToString

#
public override string ToString()
Returns a string that represents the current DashStyle.

TryParse

#
public static bool TryParse(string value, out DashStyle style)
Attempts to parse the specified value into a dash style. This can be one of the system styles (solid, dash, dot, dashdot, dashdotdot), or a series of numbers separated by commas specifying the solid and gap parts (see Dashes)
value (string)String value to parse
style (out DashStyle)DashStyle representation of the specified value if successful
True if successful, or false if the value could not be parsed

Operators

OperationResultDescription
DashStyle==DashStyleboolCompares two DashStyle objects for equality
DashStyle!=DashStyleboolCompares two DashStyle objects for inequality