Table of Contents

Class PenSettings

Namespace
OFT.Rendering.Settings
Assembly
OFT.Rendering.dll

Represents settings for a pen used for rendering.

[TypeConverter(typeof(ExpandableObjectConverter))]
public class PenSettings : RenderSettingsBase<RenderPen>
Inheritance
object
PenSettings
Extension Methods

Constructors

PenSettings()

public PenSettings()

Properties

Color

Get or set the color of the pen.

[DataMember]
[Display(ResourceType = typeof(Strings), Name = "Color", GroupName = "Common", Order = 20)]
public Color Color { get; set; }

Property Value

Color

LineDashStyle

Get or set the line dash style of the pen.

[DataMember]
[Display(ResourceType = typeof(Strings), Name = "LineDashStyle", GroupName = "Common", Order = 30)]
public LineDashStyle LineDashStyle { get; set; }

Property Value

LineDashStyle

Width

Get or set the width of the pen.

[Display(ResourceType = typeof(Strings), Name = "Width", GroupName = "Common", Order = 40)]
[Range(1, 30)]
public int Width { get; set; }

Property Value

int

Methods

Clone()

Creates a new PenSettings with the same color, dash style and width.

public override object Clone()

Returns

object

The copy.

CreateDefaultRenderObject()

Creates the default render object.

protected override RenderPen CreateDefaultRenderObject()

Returns

RenderPen

The default render object.

Equals(PenSettings)

Compares the color, width and dash style with another pen settings object.

protected bool Equals(PenSettings other)

Parameters

other PenSettings

Settings to compare with.

Returns

bool

true when the color, width and dash style are equal.

Equals(object?)

Determines whether obj is a PenSettings with the same color, width and dash style.

public override bool Equals(object? obj)

Parameters

obj object

Object to compare with.

Returns

bool

true when the settings are equal.

GenerateRenderObject()

Generates the render object based on the current settings.

protected override RenderPen GenerateRenderObject()

Returns

RenderPen

The generated render object.

GetHashCode()

Returns a hash code computed from the color, width and dash style. The values are mutable, so do not change a settings object while it is a key in a hash-based collection.

public override int GetHashCode()

Returns

int

The hash code.

Operators

operator ==(PenSettings?, PenSettings?)

Determines whether two pen settings have the same color, width and dash style; two null values are equal.

public static bool operator ==(PenSettings? left, PenSettings? right)

Parameters

left PenSettings

First settings.

right PenSettings

Second settings.

Returns

bool

true when the settings are equal.

operator !=(PenSettings?, PenSettings?)

Determines whether two pen settings differ in color, width or dash style.

public static bool operator !=(PenSettings? left, PenSettings? right)

Parameters

left PenSettings

First settings.

right PenSettings

Second settings.

Returns

bool

true when the settings are not equal.